Class: FlurryHarvest::MockClient

Inherits:
Client
  • Object
show all
Defined in:
lib/flurry_harvest/mock_client.rb

Instance Attribute Summary

Attributes inherited from Client

#agent, #api_access_code, #api_host, #api_key, #api_port, #api_url, #debug_mode, #query, #raw_data

Instance Method Summary collapse

Methods inherited from Client

#encode_mac, #log

Constructor Details

#initialize(options = {}) ⇒ MockClient

Returns a new instance of MockClient.



3
4
5
6
7
8
9
# File 'lib/flurry_harvest/mock_client.rb', line 3

def initialize(options = {})
  @debug_mode = options[:debug_mode] || false

  log "Initialize MockClient:"
  log "-------------"
  log "full options: #{options}"
end

Instance Method Details

#fetch_offers(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/flurry_harvest/mock_client.rb', line 11

def fetch_offers(options = {})
  log "fetch_offers.options: #{options}"

  @raw_data = JSON.parse(File.read("#{File.dirname(__FILE__)}/../../test/fixtures/data.json"))

  result = decode

  log "Response.raw_data: #{@raw_data}"
  log "Result: #{result.inspect}"

  return result
end