Class: RubyModKit::Memo::IvarMemo

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_mod_kit/memo/ivar_memo.rb

Overview

The memo for parameter type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ void

Parameters:

  • name (Symbol)

rbs:

  • name: Symbol

  • return: void



28
29
30
31
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 28

def initialize(name)
  @name = name
  @indent = ""
end

Instance Attribute Details

#attr_kindObject

: Symbol | nil



18
19
20
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 18

def attr_kind
  @attr_kind
end

#indentObject

: String



20
21
22
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 20

def indent
  @indent
end

#offsetObject

: Integer | nil



19
20
21
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 19

def offset
  @offset
end

#separatorObject

: String



22
23
24
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 22

def separator
  @separator
end

#typeObject

rbs:

  • @type: String | nil

  • @attr_kind: Symbol | nil

  • @offset: Integer | nil

  • @indent: String

  • @name: Symbol

  • @visibility: Symbol | nil

  • @separator: String



17
18
19
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 17

def type
  @type
end

#visibilityObject

: Symbol | nil



21
22
23
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 21

def visibility
  @visibility
end

Instance Method Details

#succ(offset_diff) ⇒ void

This method returns an undefined value.

Parameters:

rbs:

  • offset_diff: OffsetDiff

  • return: void



60
61
62
63
64
65
# File 'lib/ruby_mod_kit/memo/ivar_memo.rb', line 60

def succ(offset_diff)
  offset = @offset
  return unless offset

  @offset = offset_diff[offset]
end