Method: VersionOne::Client#get

Defined in:
lib/version-one/client.rb

#get(path, *fields) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/version-one/client.rb', line 10

def get(path, *fields)
  uri = path_uri(path)
  options = fields.last.is_a?(Hash) ? fields.pop : {}

  unless fields.empty?
    fields.concat(Query::REQUIRED_FIELDS)
    uri.query = "sel=#{fields.join(',')}"
  end

  get_uri uri, options
end