Class: Rose::ObjectAdapter
- Inherits:
-
Object
- Object
- Rose::ObjectAdapter
- Extended by:
- CoreExtensions
- Defined in:
- lib/rose/object.rb
Overview
This class is provides Objects the ability to run reports
Direct Known Subclasses
Class Method Summary collapse
- .osmosis(seedling, options = {}) ⇒ Object
-
.sprout(seedling, options = {}) ⇒ Ruport::Data::Table
The resulting table.
Methods included from CoreExtensions
Class Method Details
.osmosis(seedling, options = {}) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/rose/object.rb', line 42 def self.osmosis(seedling, ={}) hash_or_csv, items = required_values(, :with, :items) root, row = seedling.root, seedling.row idy_attr = row.identity_attribute items = case hash_or_csv when String # CSV File self.osmosis_from_csv(root, .merge( :idy_attr => idy_attr, :csv_file => hash_or_csv, :items => items )) when Hash self.osmosis_from_hash(root, .merge( :idy_attr => idy_attr, :updates => hash_or_csv, :items => items )) end self.sprout(seedling, .merge( :attributes => row.attributes, :items => items )) end |
.sprout(seedling, options = {}) ⇒ Ruport::Data::Table
Returns the resulting table.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/rose/object.rb', line 23 def self.sprout(seedling, ={}) items, attributes = required_values(, :items, :attributes) table = Ruport::Data::RoseTable.new(:column_names => attributes.column_names) self.rows(table, ) if (alterations = [:alterations]) alterations.each do |alteration| table = alteration.on(table) end end table end |