Class: OdataDuty::OAS2::IndividualDeletePath

Inherits:
Object
  • Object
show all
Defined in:
lib/odata_duty/oas2/individual_delete_path.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entity_set) ⇒ IndividualDeletePath

Returns a new instance of IndividualDeletePath.



13
14
15
# File 'lib/odata_duty/oas2/individual_delete_path.rb', line 13

def initialize(entity_set)
  @entity_set = entity_set
end

Class Method Details

.to_oas2(entity_set) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/odata_duty/oas2/individual_delete_path.rb', line 4

def self.to_oas2(entity_set)
  path_info = new(entity_set)
  {
    'operationId' => path_info.operation_id,
    'parameters' => path_info.parameters,
    'responses' => path_info.responses
  }
end

Instance Method Details

#operation_idObject



17
18
19
# File 'lib/odata_duty/oas2/individual_delete_path.rb', line 17

def operation_id
  "Delete#{@entity_set.name}"
end

#parametersObject



21
22
23
24
25
# File 'lib/odata_duty/oas2/individual_delete_path.rb', line 21

def parameters
  [
    { 'name' => 'id', 'in' => 'path', 'required' => true, 'type' => id_type }
  ]
end

#responsesObject



27
28
29
30
31
32
33
# File 'lib/odata_duty/oas2/individual_delete_path.rb', line 27

def responses
  {
    '204' => { 'description' => 'No Content' },
    'default' => { 'description' => 'Unexpected error',
                   'schema' => { '$ref' => '#/definitions/Error' } }
  }
end