Class: MrProper::DSL
- Inherits:
-
Object
- Object
- MrProper::DSL
- Defined in:
- lib/mrproper/dsl.rb
Instance Attribute Summary collapse
-
#data_blocks ⇒ Object
readonly
Returns the value of attribute data_blocks.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #data(spec = nil, &block) ⇒ Object
-
#initialize ⇒ DSL
constructor
A new instance of DSL.
- #property(message, &block) ⇒ Object
Constructor Details
#initialize ⇒ DSL
Returns a new instance of DSL.
7 8 9 10 |
# File 'lib/mrproper/dsl.rb', line 7 def initialize @properties = [] @data_blocks = [] end |
Instance Attribute Details
#data_blocks ⇒ Object (readonly)
Returns the value of attribute data_blocks.
5 6 7 |
# File 'lib/mrproper/dsl.rb', line 5 def data_blocks @data_blocks end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
5 6 7 |
# File 'lib/mrproper/dsl.rb', line 5 def properties @properties end |
Instance Method Details
#data(spec = nil, &block) ⇒ Object
12 13 14 |
# File 'lib/mrproper/dsl.rb', line 12 def data(spec = nil, &block) @data_blocks << DataBlock.new(spec, &block) end |
#property(message, &block) ⇒ Object
16 17 18 |
# File 'lib/mrproper/dsl.rb', line 16 def property(, &block) @properties << [, block] end |