Class: MOSAIK::Syntax::Reference

Inherits:
Object
  • Object
show all
Defined in:
lib/mosaik/syntax/reference.rb

Overview

Reference to a method in the codebase

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(constant, method) ⇒ Reference

Returns a new instance of Reference.



11
12
13
14
# File 'lib/mosaik/syntax/reference.rb', line 11

def initialize(constant, method)
  @constant = constant
  @method = method
end

Instance Attribute Details

#constantObject (readonly)

Returns the value of attribute constant.



9
10
11
# File 'lib/mosaik/syntax/reference.rb', line 9

def constant
  @constant
end

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/mosaik/syntax/reference.rb', line 9

def method
  @method
end

Instance Method Details

#==(other) ⇒ Object



16
17
18
19
# File 'lib/mosaik/syntax/reference.rb', line 16

def ==(other)
  constant == other.constant &&
    method == other.method
end

#inspectObject



25
26
27
# File 'lib/mosaik/syntax/reference.rb', line 25

def inspect
  "#<Reference #{self}>"
end

#to_sObject



21
22
23
# File 'lib/mosaik/syntax/reference.rb', line 21

def to_s
  "#{constant}##{method}"
end