Method: Pod4::NebulousInterface#list
- Defined in:
- lib/pod4/nebulous_interface.rb
#list(selection = nil, opts = {}) ⇒ Object
Pass a parameter string or array (which will be taken as the literal Nebulous parameter) or a Hash or Octothorpe (which will be interpreted as per your list of keys set in add_verb :list).
Returns an array of Octothorpes, or an empty array if the responder could not make any records out of our message.
Note that the ‘opts` hash is not part of the protocol supported by Pod4::Model. If you want to make use of it, you will have to write your own method for that. Supported keys:
-
caching: true if you want to use redis caching (defaults to true)
206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/pod4/nebulous_interface.rb', line 206 def list(selection=nil, opts={}) sel = case selection when Array, Hash, Octothorpe then param_string(:list, selection) else selection end caching = opts[:caching].nil? ? true : !!opts[:caching] ( verb_for(:list), sel, caching ) @response.body.is_a?(Array) ? @response.body.map{|e| Octothorpe.new e} : [] rescue => e handle_error(e) end |