Class: MrProper::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/mrproper/dsl.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDSL

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_blocksObject (readonly)

Returns the value of attribute data_blocks.



5
6
7
# File 'lib/mrproper/dsl.rb', line 5

def data_blocks
  @data_blocks
end

#propertiesObject (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(message, &block)
  @properties << [message, block]
end