Class: Acumatica::Resource
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Acumatica::Resource
- Defined in:
- lib/acumatica/resource.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(params = {}) ⇒ Resource
Returns a new instance of Resource.
70 71 72 73 |
# File 'lib/acumatica/resource.rb', line 70 def initialize(params = {}) super(format_params(params)) format_attributes! end |
Class Method Details
.create(body = {}, params = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/acumatica/resource.rb', line 15 def create(body = {}, params = {}) response = Acumatica::Client.instance.connection.put do |req| req.url url req.body = format_request_body(body) if body req.params = parse_query_params(params) if params end new(response.body) end |