Class: AdLint::Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/adlint/symbol.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Symbol

Returns a new instance of Symbol.



37
38
39
40
# File 'lib/adlint/symbol.rb', line 37

def initialize(id)
  @identifier = id
  @referred   = false
end

Instance Attribute Details

#referred=(value) ⇒ Object (writeonly)

Sets the attribute referred

Parameters:

  • value

    the value to set the attribute referred to.



42
43
44
# File 'lib/adlint/symbol.rb', line 42

def referred=(value)
  @referred = value
end

Instance Method Details

#locationObject



44
45
46
# File 'lib/adlint/symbol.rb', line 44

def location
  @identifier.location
end

#to_sObject



48
49
50
# File 'lib/adlint/symbol.rb', line 48

def to_s
  subclass_responsibility
end

#useless?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/adlint/symbol.rb', line 52

def useless?
  !@referred
end