class Shortly::Client

Public Class Methods

method_missing(method_sym, *params) click to toggle source
# File lib/shortly/client.rb, line 34
def self.method_missing(method_sym, *params) #:nodoc
  raise MethodNotAvailableError.new("Sorry, #{method_sym} method is not implemented/available for this service.")
end

Protected Class Methods

get_params(options = {}) click to toggle source
# File lib/shortly/client.rb, line 62
def self.get_params(options = {})
  {:query => options}
end
post_params(options = {}) click to toggle source
# File lib/shortly/client.rb, line 58
def self.post_params(options = {})
  {:body => options}
end
register!() click to toggle source
# File lib/shortly/client.rb, line 40
def self.register! #:nodoc
  @@registered = [] unless @@registered
  @@registered << self.name.to_sym
end
registered() click to toggle source
# File lib/shortly/client.rb, line 45
def self.registered #:nodoc
  @@registered
end
valid_uri?(url) click to toggle source

returns a uri is valid or not

# File lib/shortly/client.rb, line 54
def self.valid_uri?(url)
  !!(url =~ URI::regexp)
end
validate_uri!(url) click to toggle source
# File lib/shortly/client.rb, line 49
def self.validate_uri!(url)
  raise InvalidURIError.new("provided URI is invalid.") unless valid_uri?(url)
end