Class: Touchpass::Rp::Device

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/touchpass/rp/device.rb

Instance Method Summary collapse

Constructor Details

#initializeDevice

debug_output



7
8
9
# File 'lib/touchpass/rp/device.rb', line 7

def initialize
  self.class.base_uri Touchpass.base_uri
end

Instance Method Details

#get_all(user) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/touchpass/rp/device.rb', line 11

def get_all(user)
  http_options = { :body => {}, :headers => { Touchpass::Client::API_KEY_HEADER => Touchpass.api_key } }
  response = self.class.get("/#{user}/devices.json", http_options)

  tp_response = Touchpass::Rp::Response.new(response)
  tp_response.response = tp_response['devices'] || []
  tp_response
end