Class: StimulusReflex::ReflexFactory
- Inherits:
-
Object
- Object
- StimulusReflex::ReflexFactory
- Defined in:
- lib/stimulus_reflex/reflex_factory.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(channel, data) ⇒ ReflexFactory
constructor
A new instance of ReflexFactory.
Constructor Details
#initialize(channel, data) ⇒ ReflexFactory
Returns a new instance of ReflexFactory.
8 9 10 11 |
# File 'lib/stimulus_reflex/reflex_factory.rb', line 8 def initialize(channel, data) @channel = channel @data = StimulusReflex::ReflexData.new(data) end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
4 5 6 |
# File 'lib/stimulus_reflex/reflex_factory.rb', line 4 def channel @channel end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/stimulus_reflex/reflex_factory.rb', line 4 def data @data end |
Instance Method Details
#call ⇒ Object
13 14 15 16 |
# File 'lib/stimulus_reflex/reflex_factory.rb', line 13 def call verify_method_name! reflex_class.new(channel, reflex_data: data) end |