Class: FuzzBert::Template::Identifier

Inherits:
Object
  • Object
show all
Defined in:
lib/fuzzbert/template.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Identifier

Returns a new instance of Identifier.



143
144
145
# File 'lib/fuzzbert/template.rb', line 143

def initialize(name)
  @name = name.to_sym
end

Instance Method Details

#to_data(callbacks) ⇒ Object



147
148
149
150
151
# File 'lib/fuzzbert/template.rb', line 147

def to_data(callbacks)
  cb = callbacks[@name]
  raise RuntimeError.new "No callback set for :#{@name}" unless cb
  cb.call
end