Class: Contact
- Inherits:
-
Object
- Object
- Contact
- Defined in:
- lib/public/doc/plain-text-files/contacts_g.rb,
lib/public/doc/plain-text-files/contacts_y.rb
Constant Summary collapse
- COMPONENTS =
["home", "extras", "work"]
Instance Attribute Summary collapse
-
#dirname ⇒ Object
readonly
Returns the value of attribute dirname.
-
#email ⇒ Object
Returns the value of attribute email.
-
#extras ⇒ Object
readonly
Returns the value of attribute extras.
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#name ⇒ Object
Returns the value of attribute name.
-
#work ⇒ Object
readonly
Returns the value of attribute work.
Instance Method Summary collapse
- #close ⇒ Object
- #components ⇒ Object
-
#initialize(name) ⇒ Contact
constructor
A new instance of Contact.
- #open ⇒ Object
Constructor Details
#initialize(name) ⇒ Contact
Returns a new instance of Contact.
76 77 78 79 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 76 def initialize(name) @name = name @dirname = @name.gsub(" ", "_") end |
Instance Attribute Details
#dirname ⇒ Object (readonly)
Returns the value of attribute dirname.
74 75 76 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 74 def dirname @dirname end |
#email ⇒ Object
Returns the value of attribute email.
97 98 99 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 97 def email extras["email"] end |
#extras ⇒ Object (readonly)
Returns the value of attribute extras.
47 48 49 |
# File 'lib/public/doc/plain-text-files/contacts_y.rb', line 47 def extras @extras end |
#home ⇒ Object (readonly)
Returns the value of attribute home.
47 48 49 |
# File 'lib/public/doc/plain-text-files/contacts_y.rb', line 47 def home @home end |
#name ⇒ Object
Returns the value of attribute name.
47 48 49 |
# File 'lib/public/doc/plain-text-files/contacts_y.rb', line 47 def name @name end |
#work ⇒ Object (readonly)
Returns the value of attribute work.
47 48 49 |
# File 'lib/public/doc/plain-text-files/contacts_y.rb', line 47 def work @work end |
Instance Method Details
#close ⇒ Object
91 92 93 94 95 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 91 def close components.each do |component| component.close unless component.closed? end end |
#components ⇒ Object
81 82 83 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 81 def components COMPONENTS.map {|comp_name| self.send(comp_name) } end |
#open ⇒ Object
85 86 87 88 89 |
# File 'lib/public/doc/plain-text-files/contacts_g.rb', line 85 def open COMPONENTS.each do |component| self.send(component + "=", GDBM.new(component)) end end |