module Seoshop::ShopScript
Public Instance Methods
delete_script(script_id)
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 27 def delete_script(script_id) response = delete("#{@shop_language}/shop/scripts/#{script_id}.json") true end
get_script(script_id)
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 23 def get_script(script_id) response = get("#{@shop_language}/shop/scripts/#{script_id}.json") response.body ? response.body['shopScript'] : nil end
get_scripts(params = {})
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 8 def get_scripts(params = {}) response = get("#{@shop_language}/shop/scripts.json", params) response.body ? response.body['shopScript'] || [] : [] end
get_scripts_count(params = {})
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 4 def get_scripts_count(params = {}) response = get("#{@shop_language}/shop/scripts/count.json", params) response.body ? response.body['count'].to_i : 0 end
post_script(params)
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 13 def post_script(params) response = post("#{@shop_language}/shop/scripts.json", { "shopScript" => params }) response.body ? response.body['shopScript'] : false end
update_script(script_id, params)
click to toggle source
# File lib/seoshop-api/api/shop_script.rb, line 18 def update_script(script_id, params) response = put("#{@shop_language}/shop/scripts/#{script_id}.json", { "shopScript" => params } ) response.body ? response.body['shopScript'] : {} end