Class: Forme::Template::Form

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

Instance Method Summary collapse

Constructor Details

#initialize(form, scope) ⇒ Form

Returns a new instance of Form.



8
9
10
11
# File 'lib/forme/template.rb', line 8

def initialize(form, scope)
  @form = form
  @scope = scope
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*a, &block) ⇒ Object

Delegate calls by default to the wrapped form



14
15
16
# File 'lib/forme/template.rb', line 14

def method_missing(*a, &block)
  @form.public_send(*a, &block)
end

Instance Method Details

#emit(tag) ⇒ Object

Serialize the tag and inject it into the output.



42
43
44
45
# File 'lib/forme/template.rb', line 42

def emit(tag)
  return unless output = output()
  output << tag
end