Class: Zoopla::API

Inherits:
Object
  • Object
show all
Defined in:
lib/zoopla/api.rb

Overview

Abstract class that understands how to talk to the API

Direct Known Subclasses

AreaValueGraphs, PropertyRichList, Rentals, Sales, ZedIndex

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ API

Returns a new instance of API.



6
7
8
9
# File 'lib/zoopla/api.rb', line 6

def initialize(api_key)
  @key = api_key
  reset!      
end

Instance Method Details

#actual_locationObject

Holds standard output parameters for the call to the server, if any



20
21
22
23
# File 'lib/zoopla/api.rb', line 20

def actual_location
  return @actual_location if @actual_location
  fetch_data(@request)
end

#reset!Rentals, Sales

Resets all parameters except the API key

Returns:



13
14
15
16
17
# File 'lib/zoopla/api.rb', line 13

def reset!
  @request = default_parameters
  @actual_location = nil
  self
end