Module: Shushu::PMethod
Instance Method Summary collapse
Instance Method Details
#create(args) ⇒ Object
5 6 7 |
# File 'lib/models/p_method.rb', line 5 def create(args) Shushu.handle_req {RestClient.post(p_method_url, args, Shushu.headers)} end |
#p_method_url(id = nil) ⇒ Object
14 15 16 17 |
# File 'lib/models/p_method.rb', line 14 def p_method_url(id=nil) url = [Shushu.url, "/payment_methods"].join id.nil? ? url : url << "/#{id}" end |
#update(args) ⇒ Object
9 10 11 12 |
# File 'lib/models/p_method.rb', line 9 def update(args) id = args.delete(:id) Shushu.handle_req {RestClient.put(p_method_url(id), args, Shushu.headers)} end |