Module: ReactiveTags::ClassMethods

Defined in:
lib/volt/reactive/reactive_tags.rb

Instance Method Summary collapse

Instance Method Details

#tag_all_methods(&block) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/volt/reactive/reactive_tags.rb', line 41

def tag_all_methods(&block)
  tagger = MethodTagger.new

  tagger.instance_eval(&block)

  @reactive_method_tags ||= {}
  @reactive_method_tags[:__all_methods] = tagger.method_tags
end

#tag_method(method_name, &block) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/volt/reactive/reactive_tags.rb', line 27

def tag_method(method_name, &block)
  tagger = MethodTagger.new

  tagger.instance_eval(&block)

  @reactive_method_tags ||= {}
  @reactive_method_tags[method_name.to_sym] = tagger.method_tags

  # Track a destructive method
  if tagger.method_tags.destructive
    DestructiveMethods.add_method(method_name)
  end
end