Class: Apiture::Swagger::Path
Constant Summary collapse
- REQUEST_METHODS =
[:get, :put, :post, :delete, :options, :head, :patch]
Instance Attribute Summary collapse
-
#id ⇒ Object
(also: #path_name)
readonly
Returns the value of attribute id.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(id) ⇒ Path
constructor
A new instance of Path.
- #operations ⇒ Object
- #operations_map ⇒ Object
Methods inherited from Node
attribute, attribute_names, #collect_errors, collect_errors, #extensions, hash, hash_names, inherited, list, list_names, #serializable_hash, #to_json, #valid?, #validate
Methods included from Utils::Inflections
acronym_regex, acronyms, #camelize, #constantize, #underscore
Constructor Details
#initialize(id) ⇒ Path
Returns a new instance of Path.
18 19 20 21 |
# File 'lib/apiture/swagger/path.rb', line 18 def initialize(id) super() @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly) Also known as: path_name
Returns the value of attribute id.
7 8 9 |
# File 'lib/apiture/swagger/path.rb', line 7 def id @id end |
Instance Method Details
#operations ⇒ Object
23 24 25 |
# File 'lib/apiture/swagger/path.rb', line 23 def operations REQUEST_METHODS.map { |m| __send__(m) }.compact end |
#operations_map ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/apiture/swagger/path.rb', line 27 def operations_map REQUEST_METHODS.reduce({}) do |m, method| if op = __send__(method) m[method] = op end m end end |