lib/etsy.rb in etsy-0.2.2 vs lib/etsy.rb in etsy-0.2.3

- old
+ new

@@ -79,9 +79,20 @@ raise(ArgumentError, "environment must be set to either :sandbox or :production") end @environment = environment @host = (environment == :sandbox) ? SANDBOX_HOST : PRODUCTION_HOST end + + def self.protocol=(protocol) + unless ["http", "https"].include?(protocol.to_s) + raise(ArgumentError, "protocol must be set to either 'http' or 'https'") + end + @protocol = protocol.to_s + end + + def self.protocol + @protocol || "http" + end # The currently configured environment. # def self.environment @environment || :sandbox