Class: Druid::ResponseRow

Inherits:
Object
  • Object
show all
Defined in:
lib/druid/response_row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ ResponseRow

Returns a new instance of ResponseRow.



13
14
15
16
# File 'lib/druid/response_row.rb', line 13

def initialize(row)
  @timestamp = row['timestamp']
  @row = row['event'] || row['result']
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



18
19
20
# File 'lib/druid/response_row.rb', line 18

def method_missing(name, *args, &block)
  @row.send name, *args, &block
end

Instance Attribute Details

#rowObject (readonly)

Returns the value of attribute row.



11
12
13
# File 'lib/druid/response_row.rb', line 11

def row
  @row
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



10
11
12
# File 'lib/druid/response_row.rb', line 10

def timestamp
  @timestamp
end

Instance Method Details

#inspectObject



26
27
28
# File 'lib/druid/response_row.rb', line 26

def inspect
  "#{@timestamp.inspect}:#{@row.inspect}"
end

#to_sObject



22
23
24
# File 'lib/druid/response_row.rb', line 22

def to_s
  "#{@timestamp.to_s}:#{@row.to_s}"
end