Class: Ruflet::Rails::ResourceComponent
- Inherits:
-
Object
- Object
- Ruflet::Rails::ResourceComponent
- Includes:
- UI::SharedControlForwarders
- Defined in:
- lib/ruflet/rails/resource_component.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
-
#initialize(page, controller:) ⇒ ResourceComponent
constructor
A new instance of ResourceComponent.
Constructor Details
#initialize(page, controller:) ⇒ ResourceComponent
Returns a new instance of ResourceComponent.
13 14 15 16 |
# File 'lib/ruflet/rails/resource_component.rb', line 13 def initialize(page, controller:) @page = page @controller = controller end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, **kwargs, &block) ⇒ Object (private)
180 181 182 183 184 |
# File 'lib/ruflet/rails/resource_component.rb', line 180 def method_missing(name, *args, **kwargs, &block) return controller.__send__(name, *args, **kwargs, &block) if controller.respond_to?(name, true) super end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
11 12 13 |
# File 'lib/ruflet/rails/resource_component.rb', line 11 def controller @controller end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
11 12 13 |
# File 'lib/ruflet/rails/resource_component.rb', line 11 def page @page end |