Class: Ryac::ExternalPrefixInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/ryac/analysis/constant/rename_mapping.rb,
sig/ryac/analysis/constant/rename_mapping.rbs

Overview

Represents an external library constant prefix that can be aliased

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix_path: nil, prefix_string: nil, short_name: nil, usage_count: nil, char_savings: nil) ⇒ ExternalPrefixInfo

steep:ignore UndeclaredMethodDefinition

Parameters:

  • prefix_path: (Array[Symbol], nil) (defaults to: nil)
  • prefix_string: (String, nil) (defaults to: nil)
  • short_name: (String, nil) (defaults to: nil)
  • usage_count: (Integer, nil) (defaults to: nil)
  • char_savings: (Integer, nil) (defaults to: nil)


15
16
17
18
19
20
21
22
23
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 15

def initialize(prefix_path: nil, prefix_string: nil, short_name: nil, # steep:ignore UndeclaredMethodDefinition
               usage_count: nil, char_savings: nil)
  # @type self: ExternalPrefixInfo
  self.prefix_path = prefix_path || []
  self.prefix_string = prefix_string
  self.short_name = short_name
  self.usage_count = usage_count || 0
  self.char_savings = char_savings || 0
end

Instance Attribute Details

#char_savings ⇒ Object

Returns the value of attribute char_savings

Returns:

  • (Object) —

    the current value of char_savings



7
8
9
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 7

def char_savings
  @char_savings
end

#prefix_path ⇒ Object

Returns the value of attribute prefix_path

Returns:

  • (Object) —

    the current value of prefix_path



7
8
9
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 7

def prefix_path
  @prefix_path
end

#prefix_string ⇒ Object

Returns the value of attribute prefix_string

Returns:

  • (Object) —

    the current value of prefix_string



7
8
9
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 7

def prefix_string
  @prefix_string
end

#short_name ⇒ Object

Returns the value of attribute short_name

Returns:

  • (Object) —

    the current value of short_name



7
8
9
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 7

def short_name
  @short_name
end

#usage_count ⇒ Object

Returns the value of attribute usage_count

Returns:

  • (Object) —

    the current value of usage_count



7
8
9
# File 'lib/ryac/analysis/constant/rename_mapping.rb', line 7

def usage_count
  @usage_count
end

Class Method Details

.new ⇒ ExternalPrefixInfo

Parameters:

  • prefix_path: (Array[Symbol], nil)
  • prefix_string: (String, nil)
  • short_name: (String, nil)
  • usage_count: (Integer, nil)
  • char_savings: (Integer, nil)

Returns:



9
# File 'sig/ryac/analysis/constant/rename_mapping.rbs', line 9

def self.new: (?prefix_path: Array[Symbol]?, ?prefix_string: String?, ?short_name: String?, ?usage_count: Integer?, ?char_savings: Integer?) -> ExternalPrefixInfo