Class: ROX::MappableColumn
Instance Attribute Summary
Attributes inherited from Column
#name, #number, #options, #type
Instance Method Summary collapse
- #from_ox(client, value) ⇒ Object
-
#initialize(number, name, type, options) ⇒ MappableColumn
constructor
A new instance of MappableColumn.
- #to_ox(client, value) ⇒ Object
Constructor Details
#initialize(number, name, type, options) ⇒ MappableColumn
Returns a new instance of MappableColumn.
25 26 27 28 29 |
# File 'lib/rox/rox.rb', line 25 def initialize(number, name, type, ) super(number, name, type, ) @from_ox = @inverse = @from_ox.inject({}) {|memo, pair| memo[pair[1]] = pair[0]; memo} if end |
Instance Method Details
#from_ox(client, value) ⇒ Object
35 36 37 |
# File 'lib/rox/rox.rb', line 35 def from_ox(client, value) @from_ox[value] end |
#to_ox(client, value) ⇒ Object
31 32 33 |
# File 'lib/rox/rox.rb', line 31 def to_ox(client, value) @inverse[value] end |