Class: Flippa::Client
- Inherits:
-
Object
- Object
- Flippa::Client
- Defined in:
- lib/flippa/client.rb
Constant Summary collapse
- URL =
"https://api.flippa.com"
Instance Attribute Summary collapse
-
#last_response ⇒ Object
readonly
Returns the value of attribute last_response.
Instance Method Summary collapse
-
#initialize(access_token: nil) ⇒ Client
constructor
A new instance of Client.
- #listings(options = {}) ⇒ Object
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_response ⇒ Object (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( = {}) @last_response = client.get "/v3/listings", @last_response.body["data"].map do |listing| Listing.new(listing) end end |