Class: ApiCanon::Swagger::ApiDeclaration::Api
- Inherits:
-
ActiveModel::Serializer
- Object
- ActiveModel::Serializer
- ApiCanon::Swagger::ApiDeclaration::Api
- Defined in:
- lib/api_canon/swagger/api_declaration.rb
Defined Under Namespace
Classes: Operation
Instance Method Summary collapse
Instance Method Details
#operations ⇒ Object
43 44 45 |
# File 'lib/api_canon/swagger/api_declaration.rb', line 43 def operations [ Operation.new(object) ] end |
#path ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/api_canon/swagger/api_declaration.rb', line 21 def path url = URI.unescape url_for(url_params) # This is required because we dont know if the params are # path params or query params, this way we dont care. url.split('?').first end |
#url_params ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/api_canon/swagger/api_declaration.rb', line 29 def url_params url_params = { :controller => object.controller_path, :action => object.action_name, :only_path => true } object.params.keys.each do |name| url_params[name] = "{#{name}}" end url_params end |