Class: Bipbop::Client::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/bipbop/table.rb

Instance Method Summary collapse

Constructor Details

#initialize(ws, database, dom_node, dom) ⇒ Table

Returns a new instance of Table.



9
10
11
12
13
14
# File 'lib/bipbop/table.rb', line 9

def initialize(ws, database, dom_node, dom)
  @ws = ws
  @dom_node = dom_node
  @dom = dom
  @database = database
end

Instance Method Details

#get(attribute) ⇒ Object



26
27
28
# File 'lib/bipbop/table.rb', line 26

def get(attribute)
  @dom_node[attribute]
end

#get_fieldsObject



16
17
18
19
20
# File 'lib/bipbop/table.rb', line 16

def get_fields
  @dom_node.xpath(".//field").each { |field|
    yield Bipbop::Client::Field.new(self, @database, field, @dom)
  }        
end

#nameObject



22
23
24
# File 'lib/bipbop/table.rb', line 22

def name
  @dom_node['name']
end