Class: AdvAccessor::Base
- Inherits:
-
Object
- Object
- AdvAccessor::Base
- Includes:
- FromHash
- Defined in:
- lib/adv_accessor/base.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#null_value ⇒ Object
Returns the value of attribute null_value.
-
#reader ⇒ Object
Returns the value of attribute reader.
Instance Method Summary collapse
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method.
4 5 6 |
# File 'lib/adv_accessor/base.rb', line 4 def method @method end |
#null_value ⇒ Object
Returns the value of attribute null_value.
5 6 7 |
# File 'lib/adv_accessor/base.rb', line 5 def null_value @null_value end |
#reader ⇒ Object
Returns the value of attribute reader.
6 7 8 |
# File 'lib/adv_accessor/base.rb', line 6 def reader @reader end |
Instance Method Details
#basic_value ⇒ Object
15 16 17 18 19 |
# File 'lib/adv_accessor/base.rb', line 15 def basic_value res = raw_value res = reader[res] if reader res end |
#raw_value ⇒ Object
10 11 12 13 14 |
# File 'lib/adv_accessor/base.rb', line 10 def raw_value return @value if @value @value = null_value[] if null_value @value end |
#value(type = nil) ⇒ Object
20 21 22 23 |
# File 'lib/adv_accessor/base.rb', line 20 def value(type=nil) return basic_value unless type readers.get(type) end |
#value=(x) ⇒ Object
7 8 9 |
# File 'lib/adv_accessor/base.rb', line 7 def value=(x) @input_value = @value = x end |