Class: Etsy::ShippingTemplate

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/etsy/shipping_template.rb

Class Method Summary collapse

Methods included from Model

included, #initialize, #result, #secret, #token

Class Method Details

.create(options = {}) ⇒ Object



9
10
11
12
# File 'lib/etsy/shipping_template.rb', line 9

def self.create(options = {})
  options.merge!(:require_secure => true)
  post("/shipping/templates", options)
end

.find(id, credentials = {}) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/etsy/shipping_template.rb', line 14

def self.find(id, credentials = {})
  options = {
    :access_token => credentials[:access_token],
    :access_secret => credentials[:access_secret],
    :require_secure => true
  }
  get("/shipping/templates/#{id}", options)
end

.find_by_user(user, credentials = {}) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/etsy/shipping_template.rb', line 23

def self.find_by_user(user, credentials = {})
  options = {
    :access_token => credentials[:access_token],
    :access_secret => credentials[:access_secret],
    :require_secure => true
  }
  get("/users/#{user.id}/shipping/templates", options)
end