Sha256: c88b22df5736e6067a5014fa713b7faca40dc8bddfdb89c7223f4deda6025caf

Contents?: true

Size: 261 Bytes

Versions: 8

Compression:

Stored size: 261 Bytes

Contents

class Array

  def slice_exists? slice
    start = slice.first
    len = slice.size
    each_with_index do |e, i|
      return true if e == start && self[i,len] == slice
    end
    false
  end

  def to_c
    Terraformer::Coordinate.from_array self
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
terraformer-0.1.0 lib/ext/array.rb
terraformer-0.0.9 lib/ext/array.rb
terraformer-0.0.8 lib/ext/array.rb
terraformer-0.0.7 lib/ext/array.rb
terraformer-0.0.6 lib/ext/array.rb
terraformer-0.0.4 lib/ext/array.rb
terraformer-0.0.3 lib/ext/array.rb
terraformer-0.0.2 lib/ext/array.rb