Class: Zoopla::AreaValueGraphs

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

Instance Method Summary collapse

Methods inherited from API

#actual_location, #initialize, #reset!

Constructor Details

This class inherits a constructor from Zoopla::API

Instance Method Details

#in(location) ⇒ AreaValueGraphs

Defines the search area. All possible params are described at developer.zoopla.com/docs/

Parameters:

  • Location (Hash)

    hash

Returns:



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/zoopla/area_value_graphs.rb', line 8

def in(location)
  check_output_type location
  @request.merge! location
  reply = fetch_data(@request)
  fields = %w(area_values_url home_values_graph_url value_trend_graph_url value_ranges_graph_url average_values_graph_url)
  filtered = fields.inject({}) do |result, field|
    result[field] = reply[field]
    result
  end
  Hashie::Mash.new.update filtered
end

#largeObject

Sets the size of the returned images to large

Returns:

  • AreaValueGraphs



36
37
38
39
# File 'lib/zoopla/area_value_graphs.rb', line 36

def large
  @request[:size] = 'large'
  self
end

#mediumObject

Sets the size of the returned images to medium

Returns:

  • AreaValueGraphs



29
30
31
32
# File 'lib/zoopla/area_value_graphs.rb', line 29

def medium
  @request[:size] = 'medium'
  self
end

#smallObject

Sets the size of the returned images to small

Returns:

  • AreaValueGraphs



22
23
24
25
# File 'lib/zoopla/area_value_graphs.rb', line 22

def small
  @request[:size] = 'small'
  self
end