Class: Row

Inherits:
Object
  • Object
show all
Defined in:
lib/asker/data/row.rb

Overview

Row objects

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, index, xml_data) ⇒ Row

Initialize Row Object

Parameters:

  • table (Table)
  • index (Integer)
  • xml_data (XML)


17
18
19
20
21
22
23
24
25
26
27
# File 'lib/asker/data/row.rb', line 17

def initialize(table, index, xml_data)
  @table   = table
  @index   = index
  @id      = "#{@table.id}.#{@index}"
  @langs   = @table.langs
  @types   = @table.types
  @raws    = []
  @columns = []
  @simple  = { lang: true, type: true }
  read_data_from_xml(xml_data)
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



9
10
11
# File 'lib/asker/data/row.rb', line 9

def columns
  @columns
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/asker/data/row.rb', line 8

def id
  @id
end

#indexObject (readonly)

Returns the value of attribute index.



8
9
10
# File 'lib/asker/data/row.rb', line 8

def index
  @index
end

#langsObject (readonly)

Returns the value of attribute langs.



9
10
11
# File 'lib/asker/data/row.rb', line 9

def langs
  @langs
end

#rawsObject (readonly)

Returns the value of attribute raws.



9
10
11
# File 'lib/asker/data/row.rb', line 9

def raws
  @raws
end

#simpleObject (readonly)

Returns the value of attribute simple.



10
11
12
# File 'lib/asker/data/row.rb', line 10

def simple
  @simple
end

#tableObject (readonly)

Returns the value of attribute table.



8
9
10
# File 'lib/asker/data/row.rb', line 8

def table
  @table
end

#typesObject (readonly)

Returns the value of attribute types.



9
10
11
# File 'lib/asker/data/row.rb', line 9

def types
  @types
end

Instance Method Details

#simple_off(option) ⇒ Object



29
30
31
32
# File 'lib/asker/data/row.rb', line 29

def simple_off(option)
  @simple[option] = false
  @table.simple_off(option)
end