Class: OasCore::Spec::PathItem

Inherits:
Object
  • Object
show all
Includes:
Specable
Defined in:
lib/oas_core/spec/path_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Specable

#as_json, #to_spec

Constructor Details

#initialize(specification) ⇒ PathItem

Returns a new instance of PathItem.



9
10
11
12
13
14
15
16
# File 'lib/oas_core/spec/path_item.rb', line 9

def initialize(specification)
  @specification = specification
  @get = nil
  @post = nil
  @put = nil
  @patch = nil
  @delete = nil
end

Instance Attribute Details

#deleteObject (readonly)

Returns the value of attribute delete.



7
8
9
# File 'lib/oas_core/spec/path_item.rb', line 7

def delete
  @delete
end

#getObject (readonly)

Returns the value of attribute get.



7
8
9
# File 'lib/oas_core/spec/path_item.rb', line 7

def get
  @get
end

#patchObject (readonly)

Returns the value of attribute patch.



7
8
9
# File 'lib/oas_core/spec/path_item.rb', line 7

def patch
  @patch
end

#postObject (readonly)

Returns the value of attribute post.



7
8
9
# File 'lib/oas_core/spec/path_item.rb', line 7

def post
  @post
end

#putObject (readonly)

Returns the value of attribute put.



7
8
9
# File 'lib/oas_core/spec/path_item.rb', line 7

def put
  @put
end

Instance Method Details

#add_operation(http_method, operation) ⇒ Object



18
19
20
# File 'lib/oas_core/spec/path_item.rb', line 18

def add_operation(http_method, operation)
  instance_variable_set("@#{http_method}", operation)
end

#oas_fieldsObject



22
23
24
# File 'lib/oas_core/spec/path_item.rb', line 22

def oas_fields
  OasCore.config.http_verbs
end