Class: MyChart::X
- Inherits:
-
Object
- Object
- MyChart::X
- Defined in:
- lib/my_chart/x.rb
Instance Method Summary collapse
- #==(obj) ⇒ Object
- #group_by(&blk) ⇒ Object
-
#initialize(objs) ⇒ X
constructor
A new instance of X.
- #select(&blk) ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(objs) ⇒ X
Returns a new instance of X.
5 6 7 |
# File 'lib/my_chart/x.rb', line 5 def initialize objs @objs = objs end |
Instance Method Details
#==(obj) ⇒ Object
21 22 23 |
# File 'lib/my_chart/x.rb', line 21 def == obj obj.kind_of? X and value == obj.value end |
#group_by(&blk) ⇒ Object
13 14 15 |
# File 'lib/my_chart/x.rb', line 13 def group_by &blk XY.new value.group_by(&blk) end |
#select(&blk) ⇒ Object
9 10 11 |
# File 'lib/my_chart/x.rb', line 9 def select &blk X.new value.select(&blk) end |
#value ⇒ Object
17 18 19 |
# File 'lib/my_chart/x.rb', line 17 def value @objs end |