Sha256: 6f005d018fe63443630f8d9a7963c846ac793400ff12ad3d1f913c7d2f8f04a3

Contents?: true

Size: 243 Bytes

Versions: 3

Compression:

Stored size: 243 Bytes

Contents

module MustacheRender
  class ArrayUtil
    def self.extract_options!(arr)
      if arr.last.is_a?(Hash)
        arr.pop
      else
        {}
      end
    end

    def self.init args
      args.is_a?(Array) ? args : [args]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mustache_render-0.0.24 lib/mustache_render/utils/array_util.rb
mustache_render-0.0.23 lib/mustache_render/utils/array_util.rb
mustache_render-0.0.22 lib/mustache_render/utils/array_util.rb