Class: Terastream::Query::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/terastream/query/records_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Record

Returns a new instance of Record.



18
19
20
# File 'lib/terastream/query/records_builder.rb', line 18

def initialize(data = {})
  @data = OpenStruct.new(data)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/terastream/query/records_builder.rb', line 22

def method_missing(name, *args, &block)
  if data.respond_to?(name)
    data.send(:name, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



16
17
18
# File 'lib/terastream/query/records_builder.rb', line 16

def data
  @data
end