Module: Rose

Defined in:
lib/rose.rb,
lib/rose/proxy.rb,
lib/rose/shell.rb,
lib/rose/object.rb,
lib/rose/seedling.rb,
lib/rose/attribute.rb,
lib/rose/active_record.rb,
lib/rose/core_extensions.rb

Defined Under Namespace

Modules: ActiveRecordExtensions, CoreExtensions, Proxy Classes: ActiveRecordAdapter, Attribute, ObjectAdapter, Seedling, Shell

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.seedlingsHash

Returns global hash of all the named seedlings.

Returns:

  • (Hash)

    global hash of all the named seedlings



12
13
14
# File 'lib/rose.rb', line 12

def seedlings
  @seedlings
end

Class Method Details

.make(name, options = {}, &blk) ⇒ Rose::Seedling

The generate Rose DSL builder

Parameters:

  • name (Symbol)

    the name of the Seedling to make

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :class (Class) — default: nil

    Used during by the adapter to enforce items types

Returns:



22
23
24
25
26
# File 'lib/rose.rb', line 22

def self.make(name, options={}, &blk)
  instance = Rose::Seedling.new(Rose::ObjectAdapter, options)
  instance.instance_eval(&blk)
  self.seedlings[name] = Shell.new(instance)
end