Class: Maglev::TagHelper::WrapperTagBuilder
- Inherits:
-
Object
- Object
- Maglev::TagHelper::WrapperTagBuilder
- Defined in:
- app/components/maglev/tag_helper.rb
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
-
#view_context ⇒ Object
readonly
Returns the value of attribute view_context.
Instance Method Summary collapse
-
#initialize(view_context, component) ⇒ WrapperTagBuilder
constructor
A new instance of WrapperTagBuilder.
- #method_missing(name, options = nil, &block) ⇒ Object
- #respond_to_missing? ⇒ Boolean
Constructor Details
#initialize(view_context, component) ⇒ WrapperTagBuilder
Returns a new instance of WrapperTagBuilder.
26 27 28 29 |
# File 'app/components/maglev/tag_helper.rb', line 26 def initialize(view_context, component) @view_context = view_context @component = component end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, options = nil, &block) ⇒ Object
31 32 33 34 35 36 |
# File 'app/components/maglev/tag_helper.rb', line 31 def method_missing(name, = nil, &block) component.wrapper_tag( ( || {}).merge(html_tag: name), &block ) end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
24 25 26 |
# File 'app/components/maglev/tag_helper.rb', line 24 def component @component end |
#view_context ⇒ Object (readonly)
Returns the value of attribute view_context.
24 25 26 |
# File 'app/components/maglev/tag_helper.rb', line 24 def view_context @view_context end |
Instance Method Details
#respond_to_missing? ⇒ Boolean
38 39 40 |
# File 'app/components/maglev/tag_helper.rb', line 38 def respond_to_missing? true end |