Class: Obfuscator::Number

Inherits:
Expression show all
Defined in:
lib/number_obfuscator/number.rb,
lib/number_obfuscator/expression.rb

Overview

This class will generate an ordinary representation of n, without further obfuscation. (TODO: generate non-decimal numbers?)

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

addType, makeExpression

Constructor Details

#initialize(n) ⇒ Number


10
11
12
# File 'lib/number_obfuscator/number.rb', line 10

def initialize(n)
  @n = n
end

Class Method Details

.canDo(n) ⇒ Object


22
23
24
# File 'lib/number_obfuscator/number.rb', line 22

def Number.canDo(n)
  true
end

.make(n, _) ⇒ Object


26
27
28
# File 'lib/number_obfuscator/number.rb', line 26

def Number.make(n, _)
  Number.new(n)
end

Instance Method Details

#to_sObject


14
15
16
# File 'lib/number_obfuscator/number.rb', line 14

def to_s
  @n.to_s
end

#to_texObject


18
19
20
# File 'lib/number_obfuscator/number.rb', line 18

def to_tex
  to_s
end