Class: SwaggerYard::ListingInfo

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yard_object) ⇒ ListingInfo

Returns a new instance of ListingInfo.



5
6
7
8
9
10
11
12
13
# File 'lib/swagger_yard/listing_info.rb', line 5

def initialize(yard_object)
  @description = yard_object.docstring

  if tag = yard_object.tags.detect {|t| t.tag_name == "resource_path"}
    @resource_path = tag.text.downcase
  end

  @authorizations = yard_object.tags.select {|t| t.tag_name == "authorize_with"}.map(&:text)
end

Instance Attribute Details

#authorizationsObject (readonly)

Returns the value of attribute authorizations.



3
4
5
# File 'lib/swagger_yard/listing_info.rb', line 3

def authorizations
  @authorizations
end

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/swagger_yard/listing_info.rb', line 3

def description
  @description
end

#resource_pathObject (readonly)

Returns the value of attribute resource_path.



3
4
5
# File 'lib/swagger_yard/listing_info.rb', line 3

def resource_path
  @resource_path
end