Class: JaxrsDoc::AnnotationsGroup
- Inherits:
-
Object
- Object
- JaxrsDoc::AnnotationsGroup
- Defined in:
- lib/annotations.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#javadoc ⇒ Object
Returns the value of attribute javadoc.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(annotations = []) ⇒ AnnotationsGroup
constructor
A new instance of AnnotationsGroup.
- #method_missing(method_name, *args) ⇒ Object
- #size ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(annotations = []) ⇒ AnnotationsGroup
Returns a new instance of AnnotationsGroup.
49 50 51 |
# File 'lib/annotations.rb', line 49 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
53 54 55 56 57 58 59 |
# File 'lib/annotations.rb', line 53 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 (readonly)
Returns the value of attribute annotations.
46 47 48 |
# File 'lib/annotations.rb', line 46 def annotations @annotations end |
#javadoc ⇒ Object
Returns the value of attribute javadoc.
47 48 49 |
# File 'lib/annotations.rb', line 47 def javadoc @javadoc end |
Instance Method Details
#empty? ⇒ Boolean
61 62 63 |
# File 'lib/annotations.rb', line 61 def empty? @annotations.empty? end |
#size ⇒ Object
65 66 67 |
# File 'lib/annotations.rb', line 65 def size @annotations.size end |
#to_s ⇒ Object
69 70 71 |
# File 'lib/annotations.rb', line 69 def to_s @annotations.to_s end |