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/required_attributes_validator.rb

Defined Under Namespace

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMailAccount



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

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

#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



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

def set_default_flag
  @default = false
end

#set_default_mailboxesObject



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

def set_default_mailboxes
  @mailboxes = []
end

#to_strObject



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

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