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



17
18
19
# File 'lib/riak/core_ext/extract_options.rb', line 17

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

#to_paramObject



28
29
30
# File 'lib/riak/core_ext/to_param.rb', line 28

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

#to_query(key) ⇒ Object



32
33
34
35
# File 'lib/riak/core_ext/to_param.rb', line 32

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