Class: Tapioca::RBI::TypeMember

Inherits:
Node
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/tapioca/rbi/model.rb,
lib/tapioca/rbi/printer.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#parent_tree

Instance Method Summary collapse

Methods inherited from Node

#detach, #group_kind, #oneline?, #print, #string

Constructor Details

#initialize(name, value) ⇒ TypeMember

Returns a new instance of TypeMember.



396
397
398
399
400
# File 'lib/tapioca/rbi/model.rb', line 396

def initialize(name, value)
  super()
  @name = name
  @value = value
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



393
394
395
# File 'lib/tapioca/rbi/model.rb', line 393

def name
  @name
end

#valueObject (readonly)

Returns the value of attribute value.



393
394
395
# File 'lib/tapioca/rbi/model.rb', line 393

def value
  @value
end

Instance Method Details

#accept_printer(v) ⇒ Object



366
367
368
369
370
371
# File 'lib/tapioca/rbi/printer.rb', line 366

def accept_printer(v)
  previous_node = v.previous_node
  v.printn if previous_node && (!previous_node.oneline? || !oneline?)

  v.printl("#{name} = #{value}")
end