Module: Shushu::RCode
Instance Method Summary collapse
Instance Method Details
#create(args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/models/r_code.rb', line 5 def create(args) if args[:slug].nil? Shushu.handle_req do RestClient.post(rate_codes_url, args, Shushu.headers) end else Shushu.handle_req do url = [rate_codes_url, args.delete(:slug)].join("/") RestClient.put(url, args, Shushu.headers) end end end |