Module: Annotations::ClassMethods
- Defined in:
- lib/simple-annotations.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/simple-annotations.rb', line 55
def method_missing(meth, *args)
return super unless /\A§/ =~ meth
@last_annotations ||= {}
if args.size == 0
@last_annotations[meth[1..-1].to_sym] = true
elsif args.size == 1
@last_annotations[meth[1..-1].to_sym] = args.first
else
@last_annotations[meth[1..-1].to_sym] = args
end
end
|
Instance Method Details
#annotations(meth = nil) ⇒ Object