Method: Eve::API::Response::Rowset#initialize

Defined in:
lib/eve/api/response/rowset.rb

#initialize(rowset) ⇒ Rowset

Returns a new instance of Rowset.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/eve/api/response/rowset.rb', line 4

def initialize(rowset)
  super()

  @columns = rowset.attributes['columns'].value.split(/\s*,\s*/)
  @name = rowset.attributes['name'].value

  if rowset.attributes.key?('key')
    @key  = rowset.attributes['key'].value
  end

  rowset.children.each do |child|
    self << Eve::API::Response::Row.new(child, @columns) unless child.text?
  end
end