Class: Pageflow::Admin::ExtensibleAttributesTable::RowDelegator Private

Inherits:
Object
  • Object
show all
Defined in:
app/views/components/pageflow/admin/extensible_attributes_table.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 12.2

Instance Method Summary collapse

Constructor Details

#initialize(context, row_handler) ⇒ RowDelegator

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of RowDelegator.

Since:

  • 12.2



62
63
64
65
# File 'app/views/components/pageflow/admin/extensible_attributes_table.rb', line 62

def initialize(context, row_handler)
  @context = context
  @row_handler = row_handler
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object (private)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Normally we would delegate to super if context does not respond_to? method. But Arbre appears to report not to repond to helpers like authorized? even if it does.

This is also the reason we can not use SimpleDelegator here and also delegate_missing in Rails 5 would not work.

Since:

  • 12.2



83
84
85
# File 'app/views/components/pageflow/admin/extensible_attributes_table.rb', line 83

def method_missing(method, ...)
  @context.public_send(method, ...)
end

Instance Method Details

#row(name, options = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 12.2



67
68
69
# File 'app/views/components/pageflow/admin/extensible_attributes_table.rb', line 67

def row(name, options = {}, &)
  @row_handler.row(name, options, &)
end