Class: Phlex::Rails::Buffered
- Inherits:
-
BasicObject
- Defined in:
- lib/phlex/rails/buffered.rb
Instance Method Summary
collapse
Constructor Details
#initialize(object, component:) ⇒ Buffered
Returns a new instance of Buffered.
9
10
11
12
|
# File 'lib/phlex/rails/buffered.rb', line 9
def initialize(object, component:)
@object = object
@component = component
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(&block) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/phlex/rails/buffered.rb', line 30
def method_missing(*, **, &block)
if block
@component.raw(
@object.public_send(*, **) { |*a| @component.capture(*a, &block) }
)
else
@component.raw(
@object.public_send(*, **)
)
end
end
|
Instance Method Details
#inspect ⇒ Object
18
19
20
|
# File 'lib/phlex/rails/buffered.rb', line 18
def inspect
"Phlex::Rails::Buffered(#{@object.inspect})"
end
|
#respond_to_missing? ⇒ Boolean
26
27
28
|
# File 'lib/phlex/rails/buffered.rb', line 26
def respond_to_missing?(...)
@object.respond_to?(...)
end
|
#unwrap ⇒ Object
22
23
24
|
# File 'lib/phlex/rails/buffered.rb', line 22
def unwrap
@object
end
|