Class: Flippa::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/flippa/client.rb

Constant Summary collapse

URL =
"https://api.flippa.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token: nil) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/flippa/client.rb', line 7

def initialize(access_token: nil)
  @access_token = access_token
end

Instance Attribute Details

#last_responseObject (readonly)

Returns the value of attribute last_response.



5
6
7
# File 'lib/flippa/client.rb', line 5

def last_response
  @last_response
end

Instance Method Details

#listings(options = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/flippa/client.rb', line 11

def listings(options = {})
  @last_response = client.get "/v3/listings", options
  @last_response.body["data"].map do |listing|
    Listing.new(listing)
  end
end