Class: Declarative::Definitions::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/declarative/definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, &block) ⇒ Definition

Returns a new instance of Definition.



4
5
6
7
# File 'lib/declarative/definitions.rb', line 4

def initialize(name, options={}, &block)
  @options = options.clone
  @options[:name] = name.to_s
end

Instance Attribute Details

#options ⇒ Object (readonly)

TODO: are we gonna keep this?



9
10
11
# File 'lib/declarative/definitions.rb', line 9

def options
  @options
end

Instance Method Details

#[](name) ⇒ Object



11
12
13
# File 'lib/declarative/definitions.rb', line 11

def [](name)
  @options[name]
end