Class: Swarker::Service
- Inherits:
-
Object
- Object
- Swarker::Service
- Defined in:
- lib/swarker/service.rb
Constant Summary collapse
- DEFAULT_SCHEMA =
{ swagger: '2.0'.freeze, consumes: ['application/json'.freeze], produces: ['application/json'.freeze], info: { version: '1.0'.freeze } }
Instance Attribute Summary collapse
-
#definitions ⇒ Object
readonly
Returns the value of attribute definitions.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
Instance Method Summary collapse
-
#initialize(host, original_schema, definitions = [], paths = []) ⇒ Service
constructor
A new instance of Service.
- #json_filename ⇒ Object
Constructor Details
#initialize(host, original_schema, definitions = [], paths = []) ⇒ Service
Returns a new instance of Service.
12 13 14 15 16 17 18 19 |
# File 'lib/swarker/service.rb', line 12 def initialize(host, original_schema, definitions = [], paths = []) @host = host @original_schema = HashWithIndifferentAccess.new(original_schema) @definitions = definitions @paths = paths parse_schema end |
Instance Attribute Details
#definitions ⇒ Object (readonly)
Returns the value of attribute definitions.
10 11 12 |
# File 'lib/swarker/service.rb', line 10 def definitions @definitions end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/swarker/service.rb', line 10 def host @host end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
10 11 12 |
# File 'lib/swarker/service.rb', line 10 def paths @paths end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
10 11 12 |
# File 'lib/swarker/service.rb', line 10 def schema @schema end |
Instance Method Details
#json_filename ⇒ Object
21 22 23 |
# File 'lib/swarker/service.rb', line 21 def json_filename host || 'swagger' end |