lib/red_amber/helper.rb in red_amber-0.2.2 vs lib/red_amber/helper.rb in red_amber-0.2.3
- old
+ new
@@ -7,26 +7,14 @@
def pl(num)
num > 1 ? 's' : ''
end
- def out_of_range?(indeces)
- indeces.max >= size || indeces.min < -size
- end
-
- def integers?(enum)
- enum.all?(Integer)
- end
-
def booleans?(enum)
enum.all? { |e| e.is_a?(TrueClass) || e.is_a?(FalseClass) || e.is_a?(NilClass) }
end
- def create_dataframe_from_vector(key, vector)
- DataFrame.new(key => vector.data)
- end
-
def parse_to_vector(args, vsize: size)
a = args.reduce([]) do |accum, elem|
accum.concat(normalize_element(elem, vsize: vsize))
end
Vector.new(a)
@@ -49,10 +37,10 @@
Array(0...vsize)[elem]
elsif bg.nil? && en.nil?
Array(0...vsize)
else
- Array[elem]
+ Array(elem)
end
when Enumerator
elem.to_a
else
Array[elem]