Class: JaxrsDoc::AnnotationsGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/annotations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#annotationsObject (readonly)

Returns the value of attribute annotations.



46
47
48
# File 'lib/annotations.rb', line 46

def annotations
  @annotations
end

#javadocObject

Returns the value of attribute javadoc.



47
48
49
# File 'lib/annotations.rb', line 47

def javadoc
  @javadoc
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/annotations.rb', line 61

def empty?
  @annotations.empty?
end

#sizeObject



65
66
67
# File 'lib/annotations.rb', line 65

def size
  @annotations.size
end

#to_sObject



69
70
71
# File 'lib/annotations.rb', line 69

def to_s
  @annotations.to_s
end