Class: Mago::MagicNumber
- Inherits:
-
Object
- Object
- Mago::MagicNumber
- Defined in:
- lib/mago/magic_number.rb
Overview
Magic number. Contains value of number and line number of source code.
Instance Attribute Summary collapse
-
#line ⇒ Object
line of source file where the magic number is located.
-
#value ⇒ Object
magic number itself.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ MagicNumber
constructor
A new instance of MagicNumber.
Constructor Details
#initialize(attrs = {}) ⇒ MagicNumber
Returns a new instance of MagicNumber.
11 12 13 14 |
# File 'lib/mago/magic_number.rb', line 11 def initialize(attrs = {}) @value = attrs[:value] @line = attrs[:line] end |
Instance Attribute Details
#line ⇒ Object
line of source file where the magic number is located
8 9 10 |
# File 'lib/mago/magic_number.rb', line 8 def line @line end |
#value ⇒ Object
magic number itself
5 6 7 |
# File 'lib/mago/magic_number.rb', line 5 def value @value end |