Class: Tributa::Table::Row
- Inherits:
-
Object
- Object
- Tributa::Table::Row
- Defined in:
- lib/tributa/table/row.rb
Instance Attribute Summary collapse
-
#canton ⇒ Object
readonly
Returns the value of attribute canton.
-
#canton_rate ⇒ Object
readonly
Returns the value of attribute canton_rate.
-
#catholic_rate ⇒ Object
readonly
Returns the value of attribute catholic_rate.
-
#community ⇒ Object
readonly
Returns the value of attribute community.
-
#community_rate ⇒ Object
readonly
Returns the value of attribute community_rate.
-
#reformed_rate ⇒ Object
readonly
Returns the value of attribute reformed_rate.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(columns = []) ⇒ Row
constructor
A new instance of Row.
- #to_json ⇒ Object
Constructor Details
#initialize(columns = []) ⇒ Row
Returns a new instance of Row.
7 8 9 10 11 12 13 14 15 |
# File 'lib/tributa/table/row.rb', line 7 def initialize(columns = []) @canton, @year, @community, @canton_rate, @community_rate, @reformed_rate, @catholic_rate = columns end |
Instance Attribute Details
#canton ⇒ Object (readonly)
Returns the value of attribute canton.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def canton @canton end |
#canton_rate ⇒ Object (readonly)
Returns the value of attribute canton_rate.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def canton_rate @canton_rate end |
#catholic_rate ⇒ Object (readonly)
Returns the value of attribute catholic_rate.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def catholic_rate @catholic_rate end |
#community ⇒ Object (readonly)
Returns the value of attribute community.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def community @community end |
#community_rate ⇒ Object (readonly)
Returns the value of attribute community_rate.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def community_rate @community_rate end |
#reformed_rate ⇒ Object (readonly)
Returns the value of attribute reformed_rate.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def reformed_rate @reformed_rate end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
5 6 7 |
# File 'lib/tributa/table/row.rb', line 5 def year @year end |
Instance Method Details
#as_json ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tributa/table/row.rb', line 17 def as_json { canton: canton, year: year, community: community, canton_rate: canton_rate, community_rate: community_rate, reformed_rate: reformed_rate, catholic_rate: catholic_rate } end |
#to_json ⇒ Object
29 30 31 |
# File 'lib/tributa/table/row.rb', line 29 def to_json as_json.to_json end |