module SnowshoeRuby
Constants
- VERSION
Public Class Methods
client()
click to toggle source
# File lib/snowshoe_ruby.rb, line 10 def client @@client ||= OAuth::Consumer.new( config["key"], config["secret"], {:site => "http://beta.snowshoestamp.com/api", :scheme => :header} ) end
config()
click to toggle source
# File lib/snowshoe_ruby.rb, line 6 def config @@config ||= YAML.load(open("#{Rails.root}/config/snowshoe.yml").read)[Rails.env] end
stamp(data)
click to toggle source
# File lib/snowshoe_ruby.rb, line 20 def stamp(data) # Get Auth key with consumer @resp = client.request(:post, '/v2/stamp', nil, {}, data, { 'Content-Type' => 'application/x-www-form-urlencoded' }) # Parse response and send to template @response = JSON.parse(@resp.body) end
stamp_url()
click to toggle source
# File lib/snowshoe_ruby.rb, line 16 def stamp_url "http://beta.snowshoestamp.com/applications/client/#{config["key"]}/" end