Class: Transit::Builders::PackageBuilder
- Inherits:
-
Object
- Object
- Transit::Builders::PackageBuilder
- Defined in:
- lib/transit/builders/package_builder.rb
Instance Attribute Summary collapse
-
#form ⇒ Object
Returns the value of attribute form.
-
#resource ⇒ Object
Returns the value of attribute resource.
-
#template ⇒ Object
Returns the value of attribute template.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(model, form_builder) ⇒ PackageBuilder
constructor
A new instance of PackageBuilder.
Constructor Details
#initialize(model, form_builder) ⇒ PackageBuilder
Returns a new instance of PackageBuilder.
7 8 9 10 11 |
# File 'lib/transit/builders/package_builder.rb', line 7 def initialize(model, form_builder) @form = form_builder @resource = model @template = @form.template end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args) ⇒ Object (private)
33 34 35 36 37 38 39 40 |
# File 'lib/transit/builders/package_builder.rb', line 33 def method_missing(*args) instance_eval <<-METHOD, __FILE__, __LINE__ + 1 def #{args.first} _create_field_for(:#{args.first}) end METHOD _create_field_for(args.first.to_sym) end |
Instance Attribute Details
#form ⇒ Object
Returns the value of attribute form.
5 6 7 |
# File 'lib/transit/builders/package_builder.rb', line 5 def form @form end |
#resource ⇒ Object
Returns the value of attribute resource.
5 6 7 |
# File 'lib/transit/builders/package_builder.rb', line 5 def resource @resource end |
#template ⇒ Object
Returns the value of attribute template.
5 6 7 |
# File 'lib/transit/builders/package_builder.rb', line 5 def template @template end |
Instance Method Details
#body ⇒ Object
13 14 15 |
# File 'lib/transit/builders/package_builder.rb', line 13 def body end |