lib/ugigi.rb in ugigi-0.0.1 vs lib/ugigi.rb in ugigi-0.1

- old
+ new

@@ -9,23 +9,31 @@ require "ugigi/scheme" require "ugigi/parser" module Ugigi BASE_URL = "http://ugigi.dvrdns.org/api/search/list.json" + BASE_URL_NOAPI = "http://ugigi.dvrdns.org/search" - # @param [Hash] parameter - # @return [String] URL Serialized parameters + protected + def self.serialize_parameter parameter return "" unless parameter.class == Hash ant = Hash.new parameter.each do |key, value| ant[key.to_sym] = value.to_s end param = ant.inject(""){|k,v|k+"&#{v[0]}=#{URI.escape(v[1])}"}.sub!(/^&/,"?") return param ? param : "" end + public + def self.search(args={}) parser = Parser.new parser.fetch(args) + end + + def self.total_count(args) + parser = Parser.new + parser.total_count(args) end end