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

Returns a new instance of Definition.



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

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

Instance Attribute Details

#colorObject

Returns the value of attribute color.



24
25
26
# File 'lib/definition.rb', line 24

def color
  @color
end

#definitionObject (readonly)

Returns the value of attribute definition.



23
24
25
# File 'lib/definition.rb', line 23

def definition
  @definition
end

#expressionObject (readonly)

Returns the value of attribute expression.



23
24
25
# File 'lib/definition.rb', line 23

def expression
  @expression
end

#originObject (readonly)

Returns the value of attribute origin.



23
24
25
# File 'lib/definition.rb', line 23

def origin
  @origin
end

Instance Method Details

#<=>(other_def) ⇒ Object



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

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