Class: OpenApi::Paths
- Inherits:
-
Object
- Object
- OpenApi::Paths
- Extended by:
- Forwardable
- Includes:
- EquatableAsContent
- Defined in:
- lib/open_api/paths.rb
Overview
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**path_hash) ⇒ Paths
constructor
A new instance of Paths.
- #serializable_hash ⇒ Object
Methods included from EquatableAsContent
Constructor Details
#initialize(**path_hash) ⇒ Paths
Returns a new instance of Paths.
7 8 9 |
# File 'lib/open_api/paths.rb', line 7 def initialize(**path_hash) self.path_hash = path_hash.with_indifferent_access end |
Class Method Details
.load(hash) ⇒ Object
13 14 15 16 |
# File 'lib/open_api/paths.rb', line 13 def self.load(hash) hash = hash.map { |k, v| [k.to_sym, PathItem.load(v)] }.to_h new(**hash) end |
Instance Method Details
#serializable_hash ⇒ Object
18 19 20 |
# File 'lib/open_api/paths.rb', line 18 def serializable_hash path_hash.map { |k, v| [k.to_s, v.serializable_hash] }.to_h end |