Class: Druid::ResponseRow
- Inherits:
-
Object
- Object
- Druid::ResponseRow
- Defined in:
- lib/druid/response_row.rb
Instance Attribute Summary collapse
-
#row ⇒ Object
readonly
Returns the value of attribute row.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(row) ⇒ ResponseRow
constructor
A new instance of ResponseRow.
- #inspect ⇒ Object
- #method_missing(name, *args, &block) ⇒ Object
- #to_s ⇒ Object
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
#row ⇒ Object (readonly)
Returns the value of attribute row.
11 12 13 |
# File 'lib/druid/response_row.rb', line 11 def row @row end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
10 11 12 |
# File 'lib/druid/response_row.rb', line 10 def @timestamp end |
Instance Method Details
#inspect ⇒ Object
26 27 28 |
# File 'lib/druid/response_row.rb', line 26 def inspect "#{@timestamp.inspect}:#{@row.inspect}" end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/druid/response_row.rb', line 22 def to_s "#{@timestamp.to_s}:#{@row.to_s}" end |