Class: XanMarkup::Caller
- Inherits:
-
Object
- Object
- XanMarkup::Caller
- Defined in:
- lib/xan_markup/caller.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(context) ⇒ Caller
constructor
A new instance of Caller.
Constructor Details
#initialize(context) ⇒ Caller
Returns a new instance of Caller.
3 4 5 |
# File 'lib/xan_markup/caller.rb', line 3 def initialize(context) @context = context end |
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/xan_markup/caller.rb', line 7 def call ->(tag) do if @context.respond_to?(tag.method) @context.send(tag.method, tag.args) else "missing tag: #{tag.name}" end end end |