Module: Vident::Stimulus::Naming

Included in:
ComponentAttributeResolver, Vident::StimulusAttributes, Vident::StimulusAttributes
Defined in:
lib/vident/stimulus/naming.rb

Overview

Vident’s internal naming conventions for per-primitive wiring — the ‘add_stimulus_<plural>` mutator method, the `@stimulus_<plural>` prop ivar, and the `@stimulus_<plural>_collection` parsed-collection ivar. Mixed in by the consumers that need these helpers. Kept off `Primitive` so the primitive stays a clean domain value object and doesn’t carry the implementation details of its consumers.

Instance Method Summary collapse

Instance Method Details

#collection_ivar(primitive) ⇒ Object



16
# File 'lib/vident/stimulus/naming.rb', line 16

def collection_ivar(primitive) = :"@stimulus_#{primitive.name}_collection"

#mutator_method(primitive) ⇒ Object



12
# File 'lib/vident/stimulus/naming.rb', line 12

def mutator_method(primitive) = :"add_stimulus_#{primitive.name}"

#prop_ivar(primitive) ⇒ Object



14
# File 'lib/vident/stimulus/naming.rb', line 14

def prop_ivar(primitive) = :"@stimulus_#{primitive.name}"