Sha256: 05047453499cb9c9737797e3c941d1f61ed959e9b5c7ba4d78ae8e336048d472

Contents?: true

Size: 587 Bytes

Versions: 8

Compression:

Stored size: 587 Bytes

Contents

module Evvnt
  # Internal: Template methods to provide default behaviour for API actions.
  #
  # These are defined on Evvnt::Base subclasses where required to map the Evvnt API
  # actions.
  module InstanceTemplateMethods
    # Template method for updating a given record
    #
    # record_id - An Integer or String representing the record ID on the API.
    # params    - A Hash of params to send to the API.
    #
    # Returns {Evvnt::Base} subclass
    def update(**new_attributes)
      self.class.update(id, new_attributes) unless new_attributes == attributes
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
evvnt-0.2.6 lib/evvnt/instance_template_methods.rb
evvnt-0.2.5 lib/evvnt/instance_template_methods.rb
evvnt-0.2.4 lib/evvnt/instance_template_methods.rb
evvnt-0.2.3 lib/evvnt/instance_template_methods.rb
evvnt-0.2.2 lib/evvnt/instance_template_methods.rb
evvnt-0.2.1 lib/evvnt/instance_template_methods.rb
evvnt-0.2.0 lib/evvnt/instance_template_methods.rb
evvnt-0.1.0 lib/evvnt/instance_template_methods.rb