Module: Attic::InstanceMethods
- Defined in:
- lib/attic.rb
Instance Method Summary collapse
- #attic_variable?(n) ⇒ Boolean
- #attic_variable_get(n) ⇒ Object
- #attic_variable_set(n, v) ⇒ Object
- #attic_variables ⇒ Object (also: #attic_vars)
Instance Method Details
#attic_variable?(n) ⇒ Boolean
16 17 18 |
# File 'lib/attic.rb', line 16 def attic_variable? n self.class.attic_variable? n end |
#attic_variable_get(n) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/attic.rb', line 27 def attic_variable_get(n) if .instance_variable_get("@#{n}") else instance_variable_get("@___attic_#{n}") end end |
#attic_variable_set(n, v) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/attic.rb', line 19 def attic_variable_set(n,v) attic_variables << n unless attic_variable? n if .instance_variable_set("@#{n}", v) else instance_variable_set("@___attic_#{n}", v) end end |
#attic_variables ⇒ Object Also known as: attic_vars
12 13 14 |
# File 'lib/attic.rb', line 12 def attic_variables self.class.attic_variables end |