Class: Ick::Syntax

Inherits:
Base
  • Object
show all
Defined in:
lib/ick/syntax.rb

Direct Known Subclasses

Letn

Instance Method Summary collapse

Methods inherited from Base

belongs_to, #evaluate, evaluates_in_calling_environment, evaluates_in_value_environment, #returns, returns_result, returns_value, underscore

Instance Method Details

#invoke(value = nil, &proc) ⇒ Object



9
10
11
12
# File 'lib/ick/syntax.rb', line 9

def invoke(value = nil, &proc)
  rewritten_proc = rewrite(value, proc)
  super(value, &rewritten_proc)
end

#rewrite(value, proc) ⇒ Object



5
6
7
# File 'lib/ick/syntax.rb', line 5

def rewrite(value, proc)
  raise 'implemented by subclass or by calling meta-method!'
end