Class: CADataFrame::Arranger
- Inherits:
-
Object
- Object
- CADataFrame::Arranger
- Defined in:
- lib/carray/dataframe/dataframe.rb
Instance Method Summary collapse
- #arrange(&block) ⇒ Object
-
#initialize(dataframe) ⇒ Arranger
constructor
A new instance of Arranger.
Constructor Details
#initialize(dataframe) ⇒ Arranger
Returns a new instance of Arranger.
815 816 817 |
# File 'lib/carray/dataframe/dataframe.rb', line 815 def initialize (dataframe) @dataframe = dataframe end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
969 970 971 972 973 974 975 976 977 978 |
# File 'lib/carray/dataframe/dataframe.rb', line 969 def method_missing (name, *args) if args.size == 0 if @dataframe.column_names.include?(name.to_s) return @dataframe.columns[name.to_s] elsif @dataframe.__methods__.include?(name.to_s) return @dataframe.columns[@dataframe.__methods__[name.to_s]] end end super end |
Instance Method Details
#arrange(&block) ⇒ Object
819 820 821 822 |
# File 'lib/carray/dataframe/dataframe.rb', line 819 def arrange (&block) instance_exec(&block) return @dataframe end |