Sha256: 67a5c11fc9cd8ae98a9c753ad33080c9b963aa91cbac80e99326c85a4b2a9073

Contents?: true

Size: 670 Bytes

Versions: 5

Compression:

Stored size: 670 Bytes

Contents

require 'json'
require_relative '../concerns/modelable'

module Immoscout
  module Models
    module Actions
      module Publish
        extend ActiveSupport::Concern

        included do
          include Immoscout::Models::Concerns::Modelable

          def save
            response = api.post("publish", as_json)
            handle_response(response)
            self
          end

          def destroy
            response = api.delete(
              "publish/#{real_estate.id}_#{publish_channel.id}"
            )
            handle_response(response)
            self
          end
        end

        class_methods do
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
immoscout-1.3.1 lib/immoscout/models/actions/publish.rb
immoscout-1.3.0 lib/immoscout/models/actions/publish.rb
immoscout-1.2.0 lib/immoscout/models/actions/publish.rb
immoscout-1.1.0 lib/immoscout/models/actions/publish.rb
immoscout-1.0.0 lib/immoscout/models/actions/publish.rb