Module: ReactiveTags
- Included in:
- Channel, ChannelStub, Model, ReactiveArray, ReactiveBlock, URL
- Defined in:
- lib/volt/reactive/reactive_tags.rb
Overview
ReactiveTags provide an easy way to specify how a class deals with reactive events and method calls.als
Defined Under Namespace
Modules: ClassMethods Classes: MethodTagger, MethodTags
Class Method Summary collapse
Instance Method Summary collapse
-
#reactive_method_tag(method_name, tag_name, klass = self.class) ⇒ Object
Returns a reference to the tags on a method.
Class Method Details
.included(base) ⇒ Object
67 68 69 70 |
# File 'lib/volt/reactive/reactive_tags.rb', line 67 def self.included(base) base.send(:extend, ClassMethods) base.send(:include, Events) end |
Instance Method Details
#reactive_method_tag(method_name, tag_name, klass = self.class) ⇒ Object
Returns a reference to the tags on a method
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/volt/reactive/reactive_tags.rb', line 52 def reactive_method_tag(method_name, tag_name, klass=self.class) # Check to make sure we haven't gone above a class that has included # ReactiveTags return nil if !klass || !klass.method_defined?(:reactive_method_tag) = klass.instance_variable_get('@reactive_method_tags') if && (tag = [method_name.to_sym]) && (tag = tag.send(tag_name)) return tag end return self.reactive_method_tag(method_name, tag_name, klass.superclass) end |