Class: Blackbeard::Chart
- Inherits:
-
Object
- Object
- Blackbeard::Chart
- Defined in:
- lib/blackbeard/chart.rb
Instance Attribute Summary collapse
-
#dom_id ⇒ Object
readonly
Returns the value of attribute dom_id.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(options) ⇒ Chart
constructor
A new instance of Chart.
- #options ⇒ Object
Constructor Details
#initialize(options) ⇒ Chart
Returns a new instance of Chart.
5 6 7 8 |
# File 'lib/blackbeard/chart.rb', line 5 def initialize() [:dom_id, :height, :title].each{|m| instance_variable_set("@#{m}", [m]) } [:rows, :columns].each{|m| instance_variable_set("@#{m}", [m] || []) } end |
Instance Attribute Details
#dom_id ⇒ Object (readonly)
Returns the value of attribute dom_id.
3 4 5 |
# File 'lib/blackbeard/chart.rb', line 3 def dom_id @dom_id end |
Instance Method Details
#data ⇒ Object
14 15 16 |
# File 'lib/blackbeard/chart.rb', line 14 def data {:rows => rows, :cols => columns} end |
#options ⇒ Object
10 11 12 |
# File 'lib/blackbeard/chart.rb', line 10 def {:title => @title, :height => height} end |