Class: Mayaml::MailAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/mayaml/mail_account.rb,
lib/mayaml/mail_account/error.rb,
lib/mayaml/mail_account/builder.rb,
lib/mayaml/mail_account/port_validator.rb,
lib/mayaml/mail_account/type_validator.rb,
lib/mayaml/mail_account/mailboxes_validator.rb,
lib/mayaml/mail_account/default_flag_validator.rb,
lib/mayaml/mail_account/smtp_protocol_validator.rb,
lib/mayaml/mail_account/required_attributes_validator.rb

Defined Under Namespace

Classes: Builder, DefaultFlagValidator, Error, MailboxesValidator, MissingAttributes, PortValidator, RequiredAttributesValidator, SmtpProtocolValidator, TypeValidator, WrongAccountMailboxes, WrongAccountPort, WrongAccountSmtpPort, WrongAccountSmtpProtocol, WrongAccountType, WrongDefaultFlag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMailAccount

Returns a new instance of MailAccount.



25
26
27
28
# File 'lib/mayaml/mail_account.rb', line 25

def initialize
  set_default_flag
  set_default_mailboxes
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def default
  @default
end

#mailboxesObject

Returns the value of attribute mailboxes.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def mailboxes
  @mailboxes
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def name
  @name
end

#passObject

Returns the value of attribute pass.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def pass
  @pass
end

#portObject

Returns the value of attribute port.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def port
  @port
end

#realnameObject

Returns the value of attribute realname.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def realname
  @realname
end

#serverObject

Returns the value of attribute server.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def server
  @server
end

#smtp_authenticatorObject

Returns the value of attribute smtp_authenticator.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def smtp_authenticator
  @smtp_authenticator
end

#smtp_portObject

Returns the value of attribute smtp_port.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def smtp_port
  @smtp_port
end

#smtp_protocolObject

Returns the value of attribute smtp_protocol.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def smtp_protocol
  @smtp_protocol
end

#smtp_serverObject

Returns the value of attribute smtp_server.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def smtp_server
  @smtp_server
end

#typeObject

Returns the value of attribute type.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def type
  @type
end

#userObject

Returns the value of attribute user.



22
23
24
# File 'lib/mayaml/mail_account.rb', line 22

def user
  @user
end

Instance Method Details

#set_default_flagObject



30
31
32
# File 'lib/mayaml/mail_account.rb', line 30

def set_default_flag
  @default = false
end

#set_default_mailboxesObject



34
35
36
# File 'lib/mayaml/mail_account.rb', line 34

def set_default_mailboxes
  @mailboxes = []
end

#to_strObject



38
39
40
41
42
43
44
45
# File 'lib/mayaml/mail_account.rb', line 38

def to_str
  default_mark = @default ? "*" : ""
  <<-DESC
    Account#{default_mark}: #{@name}<#{@realname}> | user: #{@user}:#{@pass}
      #{@type} - #{@server}:#{@port} [#{@mailboxes.join(",")}]
      #{@smtp_protocol} - #{@smtp_server}:#{@smtp_port} [auth: #{@smtp_authenticator}]
  DESC
end