testing/geonames.Testing.rb
# Execute query for given +name+ with +parameters+ translated via URI
# template expansion.
Execute query for given +name+ with +parameters+ translated via URI
template expansion.
Execute query for given + name + with + parameters + translated via URI template expansion .
def query(name, parameters)
    default = {host: options[:host]}
    default[:username] = options[:username] if options[:username]
    uri = uris[name].expand(default.merge(parameters))
    if block_given?
      open(uri.to_s){|io| yield(io.read) }
    else
      open(uri.to_s){|io| JSON.parse(io.read) }
    end
  end
def query ( name , parameters ) default = { host : options [ :host ] } default [ :username ] = options [ :username ] if options [ :username ] uri = uris [ name ] . expand ( default . merge ( parameters ) ) if block_given? open ( uri . to_s ) { | io | yield ( io . read ) } else open ( uri . to_s ) { | io | JSON . parse ( io . read ) } end end
Execute query for given +name+ with +parameters+ translated via URI
template expansion.
Execute query for given + name + with + parameters + translated via URI template expansion .
name
<not_specific>
parameters
<not_specific>