Class: Mago::MagicNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/mago/magic_number.rb

Overview

Magic number. Contains value of number and line number of source code.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ MagicNumber

Returns a new instance of MagicNumber.

Parameters:

  • attrs (Hash) (defaults to: {})


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

#lineObject

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

#valueObject

magic number itself



5
6
7
# File 'lib/mago/magic_number.rb', line 5

def value
  @value
end