Class: Svelte::Path

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

Overview

Describes a Swagger API Path

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, operations:) ⇒ Path

Creates a new Path.

Parameters:

  • path (String)

    path i.e. '/store/inventory'

  • operations (Hash)

    path operations



11
12
13
14
15
# File 'lib/svelte/path.rb', line 11

def initialize(path:, operations:)
  @path = path
  separate_path_elements
  @raw_operations = operations
end

Instance Attribute Details

#non_parameter_elementsObject (readonly)

Returns the value of attribute non_parameter_elements.



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

def non_parameter_elements
  @non_parameter_elements
end

#parameter_elementsObject (readonly)

Returns the value of attribute parameter_elements.



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

def parameter_elements
  @parameter_elements
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Instance Method Details

#operationsArray<Operation>

Path operations

Returns:

  • (Array<Operation>)

    list of operations for the path



19
20
21
22
23
24
# File 'lib/svelte/path.rb', line 19

def operations
  validate_operations
  @operations ||= @raw_operations.map do |operation, properties|
    Operation.new(verb: operation, properties: properties, path: self)
  end
end