Class: Range

Inherits:
Object
  • Object
show all
Defined in:
lib/scrubyt/utils/ruby_extensions.rb

Instance Method Summary collapse

Instance Method Details

#+(amount) ⇒ Object



43
44
45
# File 'lib/scrubyt/utils/ruby_extensions.rb', line 43

def +(amount)
 (self.begin + amount)..(self.end + amount)
end

#-(amount) ⇒ Object



47
48
49
# File 'lib/scrubyt/utils/ruby_extensions.rb', line 47

def -(amount)
 (self.begin - amount)..(self.end - amount)
end

#<=>(other) ⇒ Object



39
40
41
# File 'lib/scrubyt/utils/ruby_extensions.rb', line 39

def <=>(other)
  self.begin <=> other.begin
end