Class: Ruflet::Rails::ResourceComponent

Inherits:
Object
  • Object
show all
Includes:
UI::SharedControlForwarders
Defined in:
lib/ruflet/rails/resource_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#controllerObject (readonly)

Returns the value of attribute controller.



11
12
13
# File 'lib/ruflet/rails/resource_component.rb', line 11

def controller
  @controller
end

#pageObject (readonly)

Returns the value of attribute page.



11
12
13
# File 'lib/ruflet/rails/resource_component.rb', line 11

def page
  @page
end