Class: Svelte::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/svelte/operation.rb

Overview

Describes a Swagger API Operation

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb:, properties:, path:) ⇒ Operation

Creates a new Operation.

Parameters:

  • verb (String)

    operation verb i.e. 'get'

  • properties (Hash)

    definition

  • path (Path)

    Path the operation belongs to



12
13
14
15
16
17
# File 'lib/svelte/operation.rb', line 12

def initialize(verb:, properties:, path:)
  @verb = verb
  @properties = properties
  @path = path
  validate
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/svelte/operation.rb', line 6

def path
  @path
end

#propertiesObject (readonly)

Returns the value of attribute properties.



6
7
8
# File 'lib/svelte/operation.rb', line 6

def properties
  @properties
end

#verbObject (readonly)

Returns the value of attribute verb.



6
7
8
# File 'lib/svelte/operation.rb', line 6

def verb
  @verb
end

Instance Method Details

#idString

Operation identifier

Returns:

  • (String)

    unique Swagger API operation identifier



21
22
23
# File 'lib/svelte/operation.rb', line 21

def id
  properties['operationId']
end