bigcommerce-api-ruby icon indicating copy to clipboard operation
bigcommerce-api-ruby copied to clipboard

How Does One Persist Data with This Client‽

Open sshaw opened this issue 3 years ago • 2 comments

Where is this documented? I've look at the RDocs and at the specs (🙀) and nothing works!

sshaw avatar Oct 27 '22 00:10 sshaw

rails [5.1.7] (bigcommerce-test)$ cust[0].class
=> Bigcommerce::Customer
rails [5.1.7] (bigcommerce-test)$ cust[0].class.update(cust[0].id, cust[0])
Traceback (most recent call last):
        1: from (irb):30
NoMethodError (undefined method `put' for nil:NilClass)
Did you mean?  puts
               putc
rails [5.1.7] (bigcommerce-test)$ cust[0].class.update(cust[0].id, cust[0].to_h)
Traceback (most recent call last):
        2: from (irb):31
        1: from (irb):31:in `rescue in irb_binding'
NoMethodError (undefined method `put' for nil:NilClass)
rails [5.1.7] (bigcommerce-test)$ cust[0].update
=> #<Bigcommerce::Customer ...

Of course #update is silly Hashie method.

sshaw avatar Oct 27 '22 00:10 sshaw

I did find this but given the example above update doesn't work :(

sshaw avatar Oct 27 '22 21:10 sshaw