Class: Tapioca::RBI::Const
- Extended by:
- T::Sig
- Defined in:
- lib/tapioca/rbi/model.rb,
lib/tapioca/rbi/printer.rb
Overview
Consts
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
Instance Method Summary collapse
- #accept_printer(v) ⇒ Object
-
#initialize(name, value) ⇒ Const
constructor
A new instance of Const.
Methods inherited from Node
#detach, #group_kind, #oneline?, #print, #string
Constructor Details
#initialize(name, value) ⇒ Const
Returns a new instance of Const.
109 110 111 112 113 |
# File 'lib/tapioca/rbi/model.rb', line 109 def initialize(name, value) super() @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
106 107 108 |
# File 'lib/tapioca/rbi/model.rb', line 106 def name @name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
106 107 108 |
# File 'lib/tapioca/rbi/model.rb', line 106 def value @value end |
Instance Method Details
#accept_printer(v) ⇒ Object
154 155 156 157 158 159 |
# File 'lib/tapioca/rbi/printer.rb', line 154 def accept_printer(v) previous_node = v.previous_node v.printn if previous_node && (!previous_node.oneline? || !oneline?) v.printl("#{name} = #{value}") end |