Class: NativeQuery::Row
- Inherits:
-
Object
- Object
- NativeQuery::Row
- Defined in:
- lib/native-query/row.rb
Overview
Represents one ORM row.
Instance Method Summary collapse
-
#any? ⇒ Boolean
Indicates, rows exists.
-
#initialize(data) ⇒ Row
constructor
Constructor.
-
#method_missing(sym, *args) ⇒ Object
Maps unknown calls to data fields.
-
#to_hash ⇒ Object
Converts to hash.
Constructor Details
#initialize(data) ⇒ Row
Constructor.
27 28 29 |
# File 'lib/native-query/row.rb', line 27 def initialize(data) @data = data end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
Maps unknown calls to data fields.
35 36 37 |
# File 'lib/native-query/row.rb', line 35 def method_missing(sym, *args) __data[sym] end |
Instance Method Details
#any? ⇒ Boolean
Indicates, rows exists.
43 44 45 |
# File 'lib/native-query/row.rb', line 43 def any? not __data.nil? end |
#to_hash ⇒ Object
Converts to hash.
51 52 53 |
# File 'lib/native-query/row.rb', line 51 def to_hash __data.to_hash end |