quickbooks-ruby icon indicating copy to clipboard operation
quickbooks-ruby copied to clipboard

Is there a way to assign multiple attributes after object been initialized?

Open wayne5540 opened this issue 6 years ago • 2 comments

Hi, is there a way to assign multiple attributes into model after initialized? For example:

incoive = Quickbooks::Model::Invoice.new
invoice.assign_attributes(attributes)

In this way, we don't need to manually assign attribute by using setter respectively.

I think it's useful and nice to have, in ActiveModel there is a module called AttributeAssignment, maybe we can consider adding it into BaseModel since we already have ActiveModel dependency?

wayne5540 avatar Jan 05 '19 11:01 wayne5540

I can see how this could be useful. Want to create a PR?

ruckus avatar Jan 08 '19 03:01 ruckus

My pleasure, PR: https://github.com/ruckus/quickbooks-ruby/pull/453

wayne5540 avatar Jan 08 '19 07:01 wayne5540