Class: Range

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

Overview

Direct Known Subclasses

NegRange

Instance Method Summary collapse

Instance Method Details

#-@Object


Defines unary minus operation for ranges




82
83
84
85
86
87
88
# File 'lib/R_interface/ruby_extensions.rb', line 82

def -@
  final_value = (exclude_end?)?
                  (first > last)?
                    (last + 1) : (last - 1)
                : last
  NegRange.new(self.begin, final_value)
end