Class: Rose::Shell
- Inherits:
-
Object
- Object
- Rose::Shell
- Defined in:
- lib/rose/shell.rb
Overview
This class is a wrapper around Seedling that provides methods we don’t want invoked within the Rose#make DSL.
A seedling with a shell is still a seedling. Hence, it should be have as such!
Instance Attribute Summary collapse
-
#seedling ⇒ Rose::Seedling
readonly
The current seedling.
Instance Method Summary collapse
-
#bloom(items = [], options = {}) ⇒ Ruport::Data::RoseTable
Provides bulk exporting.
-
#initialize(seedling) ⇒ Shell
constructor
A new instance of Shell.
-
#method_missing(*args, &blk) ⇒ Object
Delegates methods to the current seedling.
-
#photosynthesize(items = [], options = {}) ⇒ Object
Provides bulk importing.
Constructor Details
#initialize(seedling) ⇒ Shell
Returns a new instance of Shell.
11 12 13 |
# File 'lib/rose/shell.rb', line 11 def initialize(seedling) @seedling = seedling end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &blk) ⇒ Object
Delegates methods to the current seedling
36 37 38 |
# File 'lib/rose/shell.rb', line 36 def method_missing(*args, &blk) @seedling.send(*args, &blk) end |
Instance Attribute Details
#seedling ⇒ Rose::Seedling (readonly)
Returns the current seedling.
9 10 11 |
# File 'lib/rose/shell.rb', line 9 def seedling @seedling end |
Instance Method Details
#bloom(items = [], options = {}) ⇒ Ruport::Data::RoseTable
Provides bulk exporting
18 19 20 21 22 23 |
# File 'lib/rose/shell.rb', line 18 def bloom(items=[], ={}) @seedling.adapter.sprout(@seedling, @seedling..merge().merge( :attributes => @seedling.row.attributes, :items => items )) end |
#photosynthesize(items = [], options = {}) ⇒ Object
Provides bulk importing
29 30 31 32 33 |
# File 'lib/rose/shell.rb', line 29 def photosynthesize(items=[], ={}) @seedling.adapter.osmosis(@seedling, @seedling..merge().merge( :items => items )) end |