Class: Natsuzora::Contract::AST::Ref
- Defined in:
- lib/natsuzora/contract/ast/ref.rb
Overview
Type reference (used during parsing, resolved before use).
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name) ⇒ Ref
constructor
A new instance of Ref.
- #to_h ⇒ Object
Constructor Details
#initialize(name) ⇒ Ref
Returns a new instance of Ref.
12 13 14 15 |
# File 'lib/natsuzora/contract/ast/ref.rb', line 12 def initialize(name) super() @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/natsuzora/contract/ast/ref.rb', line 10 def name @name end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/natsuzora/contract/ast/ref.rb', line 21 def ==(other) other.is_a?(Ref) && other.name == @name end |
#to_h ⇒ Object
17 18 19 |
# File 'lib/natsuzora/contract/ast/ref.rb', line 17 def to_h { 'kind' => 'ref', 'name' => @name } end |