Class: ConstStricter::ParsedConst

Inherits:
Struct
  • Object
show all
Defined in:
lib/const_stricter/parsed_const.rb,
lib/const_stricter/parsed_const.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace:, const_name:) ⇒ ParsedConst

Returns a new instance of ParsedConst.



10
11
12
13
14
# File 'lib/const_stricter/parsed_const.rb', line 10

def initialize(namespace:, const_name:)
  super

  self.namespace ||= DEFAULT_NAMESPACE
end

Instance Attribute Details

#const_nameObject

Returns the value of attribute const_name

Returns:

  • (Object)

    the current value of const_name



2
3
4
# File 'lib/const_stricter/parsed_const.rb', line 2

def const_name
  @const_name
end

#dynamicObject

Returns the value of attribute dynamic.



5
6
7
# File 'lib/const_stricter/parsed_const.rb', line 5

def dynamic
  @dynamic
end

#locationObject

Returns the value of attribute location.



5
6
7
# File 'lib/const_stricter/parsed_const.rb', line 5

def location
  @location
end

#namespaceObject

Returns the value of attribute namespace

Returns:

  • (Object)

    the current value of namespace



2
3
4
# File 'lib/const_stricter/parsed_const.rb', line 2

def namespace
  @namespace
end

Instance Method Details

#inspectObject



16
# File 'lib/const_stricter/parsed_const.rb', line 16

def inspect = "#{namespace} { #{const_name} } → #{location}"