Class: Db2Query::Result::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/db2_query/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#definitionObject (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

#inspectObject



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