Class: Array

Inherits:
Object show all
Defined in:
lib/riak/core_ext/blank.rb,
lib/riak/core_ext/to_param.rb,
lib/riak/core_ext/extract_options.rb

Instance Method Summary collapse

Instance Method Details

#extract_options!Object



3
4
5
# File 'lib/riak/core_ext/extract_options.rb', line 3

def extract_options!
  last.is_a?(::Hash) ? pop : {}
end

#to_paramObject



14
15
16
# File 'lib/riak/core_ext/to_param.rb', line 14

def to_param
  map(&:to_param).join('/')
end

#to_query(key) ⇒ Object



18
19
20
21
# File 'lib/riak/core_ext/to_param.rb', line 18

def to_query(key)
  prefix = "#{key}[]"
  collect { |value| value.to_query(prefix) }.join '&'
end