Module: Square::APIOperations::Create
- Defined in:
- lib/square/api_operations/create.rb
Instance Method Summary collapse
-
#create(*args) ⇒ DataType
Create resource.
Instance Method Details
#create(*args) ⇒ DataType
Create resource.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/square/api_operations/create.rb', line 10 def create(*args) if args.count == 1 parent_id = nil params = args[0] elsif args.count == 2 parent_id = args[0] params = args[1] end response = Square.make_request( method: 'POST', endpoint: self.generate_endpoint_url(nil, parent_id), payload: params ) response = Square.parse_response(response) @data_type.new(response) end |