Class: SwaggerYard::ResourceListing
- Inherits:
-
Object
- Object
- SwaggerYard::ResourceListing
- Defined in:
- lib/swagger_yard/resource_listing.rb
Instance Attribute Summary collapse
-
#api_declarations ⇒ Object
readonly
Returns the value of attribute api_declarations.
-
#authorizations ⇒ Object
Returns the value of attribute authorizations.
-
#resource_to_file_path ⇒ Object
readonly
Returns the value of attribute resource_to_file_path.
Instance Method Summary collapse
- #controllers ⇒ Object
- #declaration_for(resource_name) ⇒ Object
-
#initialize(controller_path, model_path) ⇒ ResourceListing
constructor
A new instance of ResourceListing.
- #models ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(controller_path, model_path) ⇒ ResourceListing
Returns a new instance of ResourceListing.
6 7 8 9 10 11 12 |
# File 'lib/swagger_yard/resource_listing.rb', line 6 def initialize(controller_path, model_path) @model_path = model_path @controller_path = controller_path @resource_to_file_path = {} @authorizations = [] end |
Instance Attribute Details
#api_declarations ⇒ Object (readonly)
Returns the value of attribute api_declarations.
3 4 5 |
# File 'lib/swagger_yard/resource_listing.rb', line 3 def api_declarations @api_declarations end |
#authorizations ⇒ Object
Returns the value of attribute authorizations.
4 5 6 |
# File 'lib/swagger_yard/resource_listing.rb', line 4 def @authorizations end |
#resource_to_file_path ⇒ Object (readonly)
Returns the value of attribute resource_to_file_path.
3 4 5 |
# File 'lib/swagger_yard/resource_listing.rb', line 3 def resource_to_file_path @resource_to_file_path end |
Instance Method Details
#controllers ⇒ Object
18 19 20 |
# File 'lib/swagger_yard/resource_listing.rb', line 18 def controllers @controllers ||= parse_controllers end |
#declaration_for(resource_name) ⇒ Object
22 23 24 |
# File 'lib/swagger_yard/resource_listing.rb', line 22 def declaration_for(resource_name) controllers[resource_name] end |
#models ⇒ Object
14 15 16 |
# File 'lib/swagger_yard/resource_listing.rb', line 14 def models @models ||= parse_models end |
#to_h ⇒ Object
26 27 28 29 30 31 32 33 34 |
# File 'lib/swagger_yard/resource_listing.rb', line 26 def to_h { "apiVersion" => SwaggerYard.config.api_version, "swaggerVersion" => SwaggerYard.config.swagger_version, "basePath" => SwaggerYard.config.swagger_spec_base_path, "apis" => list_api_declarations, "authorizations" => } end |