Sha256: a0ba5e2899e1a8fc4cf94fbcdb3cb63f4cf7aff93dcaa0761fb04fc0af314466

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

module Fortnox
  class Track < API
    class << self
      def create(attributes={})
        attributes = attributes.reject { |k,v| k == :id } if attributes[:id]

        response = run(:post, :set_contact, with_root(attributes))
        response['result'] ? response['result']['id'].to_i : false
      end

      def update(attributes={})
        response = run :post, :set_contact, with_root(attributes)
        response['result'] ? response['result']['id'].to_i : false
      end

      private

      def with_root(attributes)
        {:contact => attributes}
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
revrise-0.0.1 lib/revrise/track.rb