Class: QueryInterface::Client::Conversion
- Inherits:
-
Object
- Object
- QueryInterface::Client::Conversion
- Defined in:
- lib/query-interface-client/types.rb
Instance Attribute Summary collapse
-
#get_block ⇒ Object
Returns the value of attribute get_block.
-
#set_block ⇒ Object
Returns the value of attribute set_block.
Instance Method Summary collapse
- #apply_get(value) ⇒ Object
- #apply_set(value) ⇒ Object
- #get(&get_block) ⇒ Object
-
#initialize ⇒ Conversion
constructor
A new instance of Conversion.
- #set(&set_block) ⇒ Object
Constructor Details
#initialize ⇒ Conversion
Returns a new instance of Conversion.
6 7 8 |
# File 'lib/query-interface-client/types.rb', line 6 def initialize self.get_block = self.set_block = Proc.new { |value| value } end |
Instance Attribute Details
#get_block ⇒ Object
Returns the value of attribute get_block.
4 5 6 |
# File 'lib/query-interface-client/types.rb', line 4 def get_block @get_block end |
#set_block ⇒ Object
Returns the value of attribute set_block.
4 5 6 |
# File 'lib/query-interface-client/types.rb', line 4 def set_block @set_block end |
Instance Method Details
#apply_get(value) ⇒ Object
22 23 24 |
# File 'lib/query-interface-client/types.rb', line 22 def apply_get(value) self.get_block.call(value) end |
#apply_set(value) ⇒ Object
18 19 20 |
# File 'lib/query-interface-client/types.rb', line 18 def apply_set(value) self.set_block.call(value) end |
#get(&get_block) ⇒ Object
14 15 16 |
# File 'lib/query-interface-client/types.rb', line 14 def get(&get_block) self.get_block = get_block end |
#set(&set_block) ⇒ Object
10 11 12 |
# File 'lib/query-interface-client/types.rb', line 10 def set(&set_block) self.set_block = set_block end |