class NativeQuery::Row
Represents one ORM row.
Public Class Methods
new(data)
click to toggle source
Constructor.
# File lib/native-query/row.rb, line 27 def initialize(data) @data = data end
Public Instance Methods
any?()
click to toggle source
Indicates, rows exists.
# File lib/native-query/row.rb, line 43 def any? not __data.nil? end
method_missing(sym, *args)
click to toggle source
Maps unknown calls to data fields.
# File lib/native-query/row.rb, line 35 def method_missing(sym, *args) __data[sym] end
to_hash()
click to toggle source
Converts to hash.
# File lib/native-query/row.rb, line 51 def to_hash __data.to_hash end
Private Instance Methods
__data()
click to toggle source
Returns data field.
# File lib/native-query/row.rb, line 60 def __data @data =begin if @__data.nil? # Calls for data and converts string keys of hash # to symbols. data = @data @__data = { } if not data.nil? @data = nil data.each_pair do |k, v| @__data[k.to_sym] = v end else @__data = nil end end return @__data =end end