Class: Orbacle::GlobalTree::Constant

Inherits:
Object
  • Object
show all
Defined in:
lib/orbacle/global_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, scope, location, definition_id = nil) ⇒ Constant

Returns a new instance of Constant.



70
71
72
73
74
75
# File 'lib/orbacle/global_tree.rb', line 70

def initialize(name, scope, location, definition_id = nil)
  @name = name
  @scope = scope
  @location = location
  @definition_id = definition_id
end

Instance Attribute Details

#definition_idObject (readonly)

Returns the value of attribute definition_id.



77
78
79
# File 'lib/orbacle/global_tree.rb', line 77

def definition_id
  @definition_id
end

#locationObject (readonly)

Returns the value of attribute location.



77
78
79
# File 'lib/orbacle/global_tree.rb', line 77

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



77
78
79
# File 'lib/orbacle/global_tree.rb', line 77

def name
  @name
end

#scopeObject (readonly)

Returns the value of attribute scope.



77
78
79
# File 'lib/orbacle/global_tree.rb', line 77

def scope
  @scope
end

Instance Method Details

#==(other) ⇒ Object



79
80
81
82
83
84
# File 'lib/orbacle/global_tree.rb', line 79

def ==(other)
  @name == other.name &&
    @scope == other.scope &&
    @location == other.location &&
    @definition_id == other.definition_id
end

#full_nameObject



86
87
88
# File 'lib/orbacle/global_tree.rb', line 86

def full_name
  [*scope.elems, @name].join("::")
end