Class: Swarker::Path
- Inherits:
-
Object
- Object
- Swarker::Path
- Defined in:
- lib/swarker/path.rb
Constant Summary collapse
- DEFAULT_SCHEMA =
{ produces: ['application/json'.freeze] }
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(name, original_schema, preparsed = false) ⇒ Path
constructor
A new instance of Path.
- #verb ⇒ Object
Constructor Details
#initialize(name, original_schema, preparsed = false) ⇒ Path
Returns a new instance of Path.
9 10 11 12 13 14 15 |
# File 'lib/swarker/path.rb', line 9 def initialize(name, original_schema, preparsed = false) @name = name @original_schema = HashWithIndifferentAccess.new(original_schema) @preparsed = preparsed parse_schema end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/swarker/path.rb', line 3 def name @name end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
3 4 5 |
# File 'lib/swarker/path.rb', line 3 def schema @schema end |
Instance Method Details
#verb ⇒ Object
17 18 19 20 |
# File 'lib/swarker/path.rb', line 17 def verb # Lurker schema has only one request verb per file @verb ||= @preparsed ? @schema.keys.first : original_schema[:extensions][:method].downcase end |