Class: MOSAIK::Syntax::Method
- Inherits:
-
Object
- Object
- MOSAIK::Syntax::Method
- Defined in:
- lib/mosaik/syntax/method.rb
Overview
Method in the codebase
Instance Attribute Summary collapse
-
#constant ⇒ Object
readonly
Returns the value of attribute constant.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(constant, name, file = nil, line = nil) ⇒ Method
constructor
A new instance of Method.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(constant, name, file = nil, line = nil) ⇒ Method
Returns a new instance of Method.
11 12 13 14 15 16 17 18 |
# File 'lib/mosaik/syntax/method.rb', line 11 def initialize(constant, name, file = nil, line = nil) @constant = constant @name = name @file = file @line = line @references = [] end |
Instance Attribute Details
#constant ⇒ Object (readonly)
Returns the value of attribute constant.
9 10 11 |
# File 'lib/mosaik/syntax/method.rb', line 9 def constant @constant end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/mosaik/syntax/method.rb', line 9 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
9 10 11 |
# File 'lib/mosaik/syntax/method.rb', line 9 def line @line end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/mosaik/syntax/method.rb', line 9 def name @name end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
9 10 11 |
# File 'lib/mosaik/syntax/method.rb', line 9 def references @references end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 |
# File 'lib/mosaik/syntax/method.rb', line 20 def ==(other) constant == other.constant && name == other.name end |
#inspect ⇒ Object
33 34 35 |
# File 'lib/mosaik/syntax/method.rb', line 33 def inspect "#<Method #{self}>" end |
#to_s ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/mosaik/syntax/method.rb', line 25 def to_s [ name, "#{file}:#{line}", "(#{references.size} references)", ].compact.join(" ") end |