lib/sungemm.rb in sungemm-0.0.2 vs lib/sungemm.rb in sungemm-0.0.3
- old
+ new
@@ -1,56 +1,9 @@
require "sungemm/version"
-
-module Sungemm
- # Finds the n-th fibonachi number.
- # @param n [Fixnum] element number in the fibonachi sequence.
- # @return [Fixnum] N-th fibo number.
- def self.fibo_finder(n)
- if (0..1).include?(n)
- n
- else
- fibo_finder(n-2)+fibo_finder(n-1)
- end
- end
-
- class Stack
- def initialize(array)
- @array = array
- end
-
- def pop(count = 1)
- r=@array.pop(count).reverse
- r=r.last if count==1
- r
- end
-
- def push(values)
- values.each {|x| @array << x}
- true
- end
-
- def to_a
- @array
- end
- end
-
- class Queue
- def initialize(array)
- @array = array
- end
-
- def pop(count = 1)
- r = @array.shift(count)
- r = r.first if count == 1
- r
- end
-
- def push(values)
- values.each { |x| @array << x }
- true
- end
-
- def to_a
- @array
- end
- end
-end
+require "sungemm/methods"
+require "sungemm/queue"
+require "sungemm/stack"
+require "sungemm/person"
+require "sungemm/character"
+require "sungemm/hash"
+require "sungemm/point"
+require "sungemm/rectangle"