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.



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

#annotationsObject (readonly)

Returns the value of attribute annotations.



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

def annotations
  @annotations
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  @annotations.empty?
end

#sizeObject



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

def size
  @annotations.size
end

#to_sObject



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

def to_s
  @annotations.to_s
end