Class: Shaf::Formable::Builder
- Inherits:
-
Object
- Object
- Shaf::Formable::Builder
- Defined in:
- lib/shaf/formable/builder.rb
Defined Under Namespace
Classes: FormWrapper
Constant Summary collapse
- DELEGATES =
%i[title name action method type submit fields].freeze
Instance Attribute Summary collapse
-
#forms ⇒ Object
readonly
Returns the value of attribute forms.
Instance Method Summary collapse
-
#initialize(&block) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(&block) ⇒ Builder
Returns a new instance of Builder.
56 57 58 59 60 61 |
# File 'lib/shaf/formable/builder.rb', line 56 def initialize(&block) @forms = [] @instance_accessors = {} exec_with_form(block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (private)
92 93 94 95 |
# File 'lib/shaf/formable/builder.rb', line 92 def method_missing(method, *args, &block) return super unless args.empty? && block exec_with_form(block, method_name: method) end |
Instance Attribute Details
#forms ⇒ Object (readonly)
Returns the value of attribute forms.
54 55 56 |
# File 'lib/shaf/formable/builder.rb', line 54 def forms @forms end |