Class: RBI::SigParam
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/printer.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
- #accept_printer(v) ⇒ Object
-
#initialize(name, type, loc: nil) ⇒ SigParam
constructor
A new instance of SigParam.
Methods inherited from Node
#compatible_with?, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #replace, #string
Constructor Details
#initialize(name, type, loc: nil) ⇒ SigParam
Returns a new instance of SigParam.
686 687 688 689 690 |
# File 'lib/rbi/model.rb', line 686 def initialize(name, type, loc: nil) super(loc: loc) @name = name @type = type end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
683 684 685 |
# File 'lib/rbi/model.rb', line 683 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
683 684 685 |
# File 'lib/rbi/model.rb', line 683 def type @type end |
Instance Method Details
#==(other) ⇒ Object
693 694 695 |
# File 'lib/rbi/model.rb', line 693 def ==(other) other.is_a?(SigParam) && name == other.name && type == other.type end |
#accept_printer(v) ⇒ Object
544 545 546 |
# File 'lib/rbi/printer.rb', line 544 def accept_printer(v) v.print("#{name}: #{type}") end |