Class: QueryInterface::Client::Conversion

Inherits:
Object
  • Object
show all
Defined in:
lib/query-interface-client/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConversion

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_blockObject

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_blockObject

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