Class: Transit::Builders::PackageBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/transit/builders/package_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#formObject

Returns the value of attribute form.



5
6
7
# File 'lib/transit/builders/package_builder.rb', line 5

def form
  @form
end

#resourceObject

Returns the value of attribute resource.



5
6
7
# File 'lib/transit/builders/package_builder.rb', line 5

def resource
  @resource
end

#templateObject

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

#bodyObject



13
14
15
# File 'lib/transit/builders/package_builder.rb', line 13

def body
  
end