Class: OpenApi::Reference
- Inherits:
-
Object
- Object
- OpenApi::Reference
- Includes:
- EquatableAsContent
- Defined in:
- lib/open_api/reference.rb
Overview
Instance Attribute Summary collapse
-
#ref ⇒ Object
Returns the value of attribute ref.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ref:) ⇒ Reference
constructor
A new instance of Reference.
- #serializable_hash ⇒ Object
Methods included from EquatableAsContent
Constructor Details
#initialize(ref:) ⇒ Reference
Returns a new instance of Reference.
8 9 10 |
# File 'lib/open_api/reference.rb', line 8 def initialize(ref:) self.ref = ref end |
Instance Attribute Details
#ref ⇒ Object
Returns the value of attribute ref.
6 7 8 |
# File 'lib/open_api/reference.rb', line 6 def ref @ref end |
Class Method Details
.load(hash) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/open_api/reference.rb', line 18 def self.load(hash) return unless hash return unless hash["$ref"] new(ref: hash["$ref"]) end |
Instance Method Details
#serializable_hash ⇒ Object
12 13 14 15 16 |
# File 'lib/open_api/reference.rb', line 12 def serializable_hash { "$ref" => ref.to_s, } end |