Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/vector_salad/monkeypatches.rb

Overview

Monkeypatches to core Ruby Fixnum class

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.unit=(unit) ⇒ Object

Set the global unit value for multiplying numbers by using tilde (~) to scale designs



11
12
13
# File 'lib/vector_salad/monkeypatches.rb', line 11

def self.unit=(unit)
  @@unit = unit
end

Instance Method Details

#unitObject

Get unit value



4
5
6
# File 'lib/vector_salad/monkeypatches.rb', line 4

def unit
  @@unit ||= 1
end