Class: Eve::API::Response::Rowset

Inherits:
Array
  • Object
show all
Includes:
Inspection, WrapObject
Defined in:
lib/eve/api/response/rowset.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from WrapObject

#wrap_object

Methods included from Inspection

#inspect, #inspected_elements, #inspected_instance_variables, #inspected_name, #inspected_rowsets, #protected_instance_variables

Constructor Details

#initialize(elem, options = {}) ⇒ Rowset

Returns a new instance of Rowset.



10
11
12
13
14
# File 'lib/eve/api/response/rowset.rb', line 10

def initialize(elem, options = {})
  super()
  @options = options
  parse_elem(elem)
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



7
8
9
# File 'lib/eve/api/response/rowset.rb', line 7

def columns
  @columns
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/eve/api/response/rowset.rb', line 7

def name
  @name
end

#primary_keyObject (readonly) Also known as: key

Returns the value of attribute primary_key.



7
8
9
# File 'lib/eve/api/response/rowset.rb', line 7

def primary_key
  @primary_key
end

Instance Method Details

#delegate_from(object) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/eve/api/response/rowset.rb', line 16

def delegate_from(object)
  klass = class << object; self; end
  var_name = name.underscore
  object.instance_variable_set("@#{var_name}", self)
  klass.send(:attr_reader, var_name)
  klass.send(:alias_method, var_name.camelize.dehumanize, var_name)
end

#to_yaml(*args) ⇒ Object



24
25
26
# File 'lib/eve/api/response/rowset.rb', line 24

def to_yaml(*args)
  to_a.to_yaml(*args)
end