Sha256: 65e934a1e8147b3f347602940b645158c40fcffce76800a07dfe8c89ef35e5d7

Contents?: true

Size: 345 Bytes

Versions: 19

Compression:

Stored size: 345 Bytes

Contents

module CurrencyCloud
  module Actions
    module Save
      def save
        return self if changed_attributes.empty?

        params = attributes.select { |attr| changed_attributes.include?(attr) }
        attrs = client.post(id, params)
        changed_attributes.clear
        self.attributes = attrs
        self
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
currency_cloud-1.5.0 lib/currency_cloud/actions/save.rb
currency_cloud-1.4.0 lib/currency_cloud/actions/save.rb
currency_cloud-1.3.1 lib/currency_cloud/actions/save.rb
currency_cloud-1.3.0 lib/currency_cloud/actions/save.rb
currency_cloud-1.2.1 lib/currency_cloud/actions/save.rb
currency_cloud-1.1.4 lib/currency_cloud/actions/save.rb
currency_cloud-1.0.3 lib/currency_cloud/actions/save.rb
currency_cloud-0.17.7 lib/currency_cloud/actions/save.rb
currency_cloud-0.16.2 lib/currency_cloud/actions/save.rb
currency_cloud-0.15.8 lib/currency_cloud/actions/save.rb
currency_cloud-0.14.2 lib/currency_cloud/actions/save.rb
currency_cloud-0.12.5 lib/currency_cloud/actions/save.rb
currency_cloud-0.12.4 lib/currency_cloud/actions/save.rb
currency_cloud-0.11.2 lib/currency_cloud/actions/save.rb
currency_cloud-0.10.0 lib/currency_cloud/actions/save.rb
currency_cloud-0.9.0 lib/currency_cloud/actions/save.rb
currency_cloud-0.8.2 lib/currency_cloud/actions/save.rb
currency_cloud-0.8.0 lib/currency_cloud/actions/save.rb
currency_cloud-0.7.2 lib/currency_cloud/actions/save.rb