Module: Ditto::DSL

Defined in:
lib/ditto/dsl.rb

Instance Method Summary collapse

Instance Method Details

#add(version, &block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/ditto/dsl.rb', line 8

def add (version, &block)
  unless block
	src = Thread.current.backtrace[1].split(':')[0..1]
	raise Error.new(src), "add method missing block (use {} not do/end)"
  end
  [:add, version, block]
end

#delete(version, &block) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/ditto/dsl.rb', line 15

def delete (version, &block)
  unless block
	src = Thread.current.backtrace[1].split(':')[0..1]
	raise Error.new(src), "delete method missing block (use {} not do/end)"
  end
  [:delete, version, block]
end

#entity(name, version, opts, *methods) ⇒ Object



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

def entity (name, version, opts, *methods)
  Ditto::Entity.new(name,version,opts,methods)
end