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.



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

def initialize
  set_default_flag
  set_default_mailboxes
end

Instance Attribute Details

#defaultObject

Returns the value of attribute default.



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

def default
  @default
end

#mailboxesObject

Returns the value of attribute mailboxes.



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

def mailboxes
  @mailboxes
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#passObject

Returns the value of attribute pass.



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

def pass
  @pass
end

#portObject

Returns the value of attribute port.



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

def port
  @port
end

#realnameObject

Returns the value of attribute realname.



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

def realname
  @realname
end

#serverObject

Returns the value of attribute server.



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

def server
  @server
end

#smtp_authenticatorObject

Returns the value of attribute smtp_authenticator.



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

def smtp_authenticator
  @smtp_authenticator
end

#smtp_portObject

Returns the value of attribute smtp_port.



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

def smtp_port
  @smtp_port
end

#smtp_protocolObject

Returns the value of attribute smtp_protocol.



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

def smtp_protocol
  @smtp_protocol
end

#smtp_serverObject

Returns the value of attribute smtp_server.



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

def smtp_server
  @smtp_server
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

Instance Method Details

#set_default_flagObject



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

def set_default_flag
  @default = false
end

#set_default_mailboxesObject



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

def set_default_mailboxes
  @mailboxes = []
end

#to_strObject



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

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