Class: Db2Query::Result::Record
- Inherits:
-
Object
- Object
- Db2Query::Result::Record
- Defined in:
- lib/db2_query/result.rb
Instance Attribute Summary collapse
-
#definition ⇒ Object
readonly
Returns the value of attribute definition.
Instance Method Summary collapse
-
#initialize(row, columns, definition) ⇒ Record
constructor
A new instance of Record.
- #inspect ⇒ Object
Constructor Details
#initialize(row, columns, definition) ⇒ Record
Returns a new instance of Record.
48 49 50 51 |
# File 'lib/db2_query/result.rb', line 48 def initialize(row, columns, definition) @definition = definition add_attributes(columns, row) end |
Instance Attribute Details
#definition ⇒ Object (readonly)
Returns the value of attribute definition.
44 45 46 |
# File 'lib/db2_query/result.rb', line 44 def definition @definition end |
Instance Method Details
#inspect ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/db2_query/result.rb', line 53 def inspect inspection = if defined?(instance_variables) && instance_variables instance_variables.reject { |var| var == :@definition }.map do |attribute| "#{attribute[1..-1]}: #{instance_variable_get(attribute)}" end.compact.join(", ") else "not initialized" end "#<Record #{inspection}>" end |