Module: Sequencescape::Api::Resource::Modifications
- Included in:
- Sequencescape::Api::Resource
- Defined in:
- lib/sequencescape-api/resource/modifications.rb
Instance Method Summary (collapse)
-
- (Modifications) initialize(api, json = nil, wrapped = false)
A new instance of Modifications.
- - (Object) save!(options = nil)
- - (Object) update_attributes!(attributes)
Instance Method Details
- (Modifications) initialize(api, json = nil, wrapped = false)
A new instance of Modifications
35 36 37 38 39 |
# File 'lib/sequencescape-api/resource/modifications.rb', line 35 def initialize(api, json = nil, wrapped = false) super update_from_json(json, wrapped) changed_attributes.clear end |
- (Object) save!(options = nil)
47 48 49 50 |
# File 'lib/sequencescape-api/resource/modifications.rb', line 47 def save!( = nil) action = persisted? ? :update : :create modify!({ :action => action }.reverse_merge( || {})) end |
- (Object) update_attributes!(attributes)
41 42 43 44 45 |
# File 'lib/sequencescape-api/resource/modifications.rb', line 41 def update_attributes!(attributes) changed_attributes.clear update_from_json(attributes, false) modify!(:action => :update) end |