Class: NativeQuery::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/native-query/row.rb

Overview

Represents one ORM row.

Instance Method Summary collapse

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, &block) ⇒ Object

Maps unknown calls to data fields.



35
36
37
# File 'lib/native-query/row.rb', line 35

def method_missing(sym, *args, &block)
    __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