Class: JaxrsDoc::AnnotationsGroup
- Inherits:
-
Object
- Object
- JaxrsDoc::AnnotationsGroup
show all
- Defined in:
- lib/annotations.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AnnotationsGroup.
48
49
50
|
# File 'lib/annotations.rb', line 48
def initialize(annotations = [])
@annotations = Array.new(annotations)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
52
53
54
55
56
57
58
|
# File 'lib/annotations.rb', line 52
def method_missing(method_name, *args)
if(method_name.to_s.include?"params")
@annotations.select{|a| /\b(Form|FormData|Query)Param\b/ =~ a.name }
else
@annotations.find {|a| method_name.to_s.eql?(a.name.downcase) }
end
end
|
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations.
46
47
48
|
# File 'lib/annotations.rb', line 46
def annotations
@annotations
end
|
Instance Method Details
#empty? ⇒ Boolean
60
61
62
|
# File 'lib/annotations.rb', line 60
def empty?
@annotations.empty?
end
|
#size ⇒ Object
64
65
66
|
# File 'lib/annotations.rb', line 64
def size
@annotations.size
end
|
#to_s ⇒ Object
68
69
70
|
# File 'lib/annotations.rb', line 68
def to_s
@annotations.to_s
end
|