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
86 87 88 |
# File 'lib/attic.rb', line 86 def attic_variable? n self.class.attic_variable? n end |
#attic_variable_get(n) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/attic.rb', line 97 def attic_variable_get(n) if .instance_variable_get("@#{n}") else instance_variable_get("@___attic_#{n}") end end |
#attic_variable_set(n, v) ⇒ Object
89 90 91 92 93 94 95 96 |
# File 'lib/attic.rb', line 89 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
82 83 84 |
# File 'lib/attic.rb', line 82 def attic_variables self.class.attic_variables end |