Class: Definition

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin, expression, definition) ⇒ Definition



31
32
33
34
35
36
# File 'lib/definition.rb', line 31

def initialize(origin, expression, definition)
  @origin = origin
  @expression = expression
  @definition = definition
  @color = nil
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



29
30
31
# File 'lib/definition.rb', line 29

def color
  @color
end

#definitionObject (readonly)

Returns the value of attribute definition.



28
29
30
# File 'lib/definition.rb', line 28

def definition
  @definition
end

#expressionObject (readonly)

Returns the value of attribute expression.



28
29
30
# File 'lib/definition.rb', line 28

def expression
  @expression
end

#originObject (readonly)

Returns the value of attribute origin.



28
29
30
# File 'lib/definition.rb', line 28

def origin
  @origin
end

Instance Method Details

#<=>(other_def) ⇒ Object



38
39
40
# File 'lib/definition.rb', line 38

def <=>(other_def)
  return @expression <=> other_def.expression 
end