Module: Gamifier::DSL

Defined in:
lib/gamifier/dsl.rb,
lib/gamifier/dsl/site.rb,
lib/gamifier/dsl/api_key.rb,
lib/gamifier/dsl/network.rb

Defined Under Namespace

Classes: ApiKey, Network, Site

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.eval_with_context(new_context, &block) ⇒ Object



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

def eval_with_context(new_context, &block)
  new_context.extend DSL
  if block
    new_context.instance_eval(&block)
  end
  new_context
end

Instance Method Details

#set(key, *args, &block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/gamifier/dsl.rb', line 17

def set(key, *args, &block)
  if block
    self.send("#{key}=".to_sym, block)
  else
    self.send("#{key}=".to_sym, *args)
  end
end