Sha256: 3a38c73b2c503e3a6805ae0b3a55532e9a03e93be2299ffb7f6f85acea9c127c

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

class RealSavvy::Adapter::Collection < RealSavvy::Adapter::Base
  path_prefix_is 'collections'

  include RealSavvy::Concern::ShowForAdapter
  include RealSavvy::Concern::IndexForAdapter
  include RealSavvy::Concern::CreateForAdapter
  include RealSavvy::Concern::UpdateForAdapter
  include RealSavvy::Concern::DestroyForAdapter
  include RealSavvy::Concern::InvitesActionsForAdapter

  def add(id:, property_ids:)
    put("./api/v3/#{path_prefix}/#{id}/add", {property_ids: property_ids})
  end

  def remove(id:, property_ids:)
    delete("./api/v3/#{path_prefix}/#{id}/remove", {property_ids: property_ids})
  end

  def search(id:, filter: {}, market_id: nil, page_size: nil, page_number: nil, page: {})
    page[:size] ||= page_size
    page[:number] ||= page_number
    post("./api/v3/#{path_prefix}/#{id}/properties/search", {filter: filter, market_id: market_id, page: page})
  end

  def cluster(id:, filter: {}, market_id: nil, page_size: nil, page_number: nil, page: {}, precision: nil)
    page[:size] ||= page_size
    page[:number] ||= page_number
    post("./api/v3/#{path_prefix}/#{id}/properties/map/clusters", {filter: filter, market_id: market_id, page: page, precision: precision})
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
real_savvy-0.0.10 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.9 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.8 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.7 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.6 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.5 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.4 lib/real_savvy/adapter/collection.rb
real_savvy-0.0.3 lib/real_savvy/adapter/collection.rb