Class: Quby::Compiler::Entities::Charting::Charts
- Inherits:
-
Object
- Object
- Quby::Compiler::Entities::Charting::Charts
- Includes:
- Enumerable
- Defined in:
- lib/quby/compiler/entities/charting/charts.rb
Instance Method Summary collapse
- #add(chart) ⇒ Object
- #each(*args, &block) ⇒ Object
- #find(key) ⇒ Object
-
#initialize ⇒ Charts
constructor
A new instance of Charts.
- #overview ⇒ Object
- #overview=(chart) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize ⇒ Charts
Returns a new instance of Charts.
10 11 12 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 10 def initialize @charts = [] end |
Instance Method Details
#add(chart) ⇒ Object
22 23 24 25 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 22 def add(chart) fail "Duplicate chart: #{chart.key} already exists!" if find(chart.key) @charts << chart end |
#each(*args, &block) ⇒ Object
31 32 33 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 31 def each(*args, &block) @charts.each(*args, &block) end |
#find(key) ⇒ Object
27 28 29 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 27 def find(key) @charts.find { |i| i.key == key } end |
#overview ⇒ Object
14 15 16 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 14 def overview @overview_chart end |
#overview=(chart) ⇒ Object
18 19 20 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 18 def overview=(chart) @overview_chart = chart end |
#size ⇒ Object
35 36 37 |
# File 'lib/quby/compiler/entities/charting/charts.rb', line 35 def size @charts.size end |