Class: AdvAccessor::Mapping
- Inherits:
-
Object
- Object
- AdvAccessor::Mapping
- Includes:
- FromHash
- Defined in:
- lib/adv_accessor/mapping.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#block ⇒ Object
Returns the value of attribute block.
-
#from ⇒ Object
Returns the value of attribute from.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
4 5 6 |
# File 'lib/adv_accessor/mapping.rb', line 4 def base @base end |
#block ⇒ Object
Returns the value of attribute block.
4 5 6 |
# File 'lib/adv_accessor/mapping.rb', line 4 def block @block end |
#from ⇒ Object
Returns the value of attribute from.
4 5 6 |
# File 'lib/adv_accessor/mapping.rb', line 4 def from @from end |
#to ⇒ Object
Returns the value of attribute to.
4 5 6 |
# File 'lib/adv_accessor/mapping.rb', line 4 def to @to end |
Instance Method Details
#match?(ops) ⇒ Boolean
6 7 8 9 10 11 12 |
# File 'lib/adv_accessor/mapping.rb', line 6 def match?(ops) if base.act_on_array && ops[:val].kind_of?(Array) from == ops[:val].first.class && to == ops[:to] else from == ops[:val].class && to == ops[:to] end end |