class LibBin::DataRange

Attributes

range[R]

Public Class Methods

new(*args) click to toggle source
# File lib/libbin/data_types.rb, line 51
def initialize(*args)
  if args.length == 2
    @range = Range::new(args[0], args[1])
  else
    @range = args[0].values.flatten.compact.collect(&:range).reduce { |memo, obj| memo + obj }
  end
end

Public Instance Methods

first() click to toggle source
# File lib/libbin/data_types.rb, line 59
def first
  @range.first
end
last() click to toggle source
# File lib/libbin/data_types.rb, line 63
def last
  @range.last
end
size() click to toggle source
# File lib/libbin/data_types.rb, line 67
def size
  @range.size
end