class XanMarkup::Caller

Public Class Methods

new(context) click to toggle source
# File lib/xan_markup/caller.rb, line 3
def initialize(context)
  @context = context
end

Public Instance Methods

call() click to toggle source
# 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