Class: Literal::Openapi::Types::RefType
- Inherits:
-
Object
- Object
- Literal::Openapi::Types::RefType
- Includes:
- Type
- Defined in:
- lib/literal/openapi/types/ref_type.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#===(other) ⇒ Object
NOTE: do NOT rewrite to ‘delegate :===, to: :@type` — the gem has no ActiveSupport dependency, so `delegate` is unavailable.
- #hash ⇒ Object
-
#initialize(type) ⇒ RefType
constructor
A new instance of RefType.
- #inspect ⇒ Object
Constructor Details
#initialize(type) ⇒ RefType
Returns a new instance of RefType.
16 17 18 19 |
# File 'lib/literal/openapi/types/ref_type.rb', line 16 def initialize(type) @type = type freeze end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
21 22 23 |
# File 'lib/literal/openapi/types/ref_type.rb', line 21 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
27 28 29 |
# File 'lib/literal/openapi/types/ref_type.rb', line 27 def ==(other) other.is_a?(Literal::Openapi::Types::RefType) && other.type == @type end |
#===(other) ⇒ Object
NOTE: do NOT rewrite to ‘delegate :===, to: :@type` — the gem has no ActiveSupport dependency, so `delegate` is unavailable.
39 40 41 |
# File 'lib/literal/openapi/types/ref_type.rb', line 39 def ===(other) @type === other # rubocop:disable Style/CaseEquality end |
#hash ⇒ Object
33 34 35 |
# File 'lib/literal/openapi/types/ref_type.rb', line 33 def hash [self.class, @type].hash end |
#inspect ⇒ Object
23 24 25 |
# File 'lib/literal/openapi/types/ref_type.rb', line 23 def inspect "_Ref(#{@type.name || "<anonymous>"})" end |