Class: YouGotListed::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/you_got_listed/resource.rb

Direct Known Subclasses

Accounts, Agent, Complexes, Lead, Listings

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Resource

Returns a new instance of Resource.



6
7
8
# File 'lib/you_got_listed/resource.rb', line 6

def initialize(client)
  self.client = client
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



4
5
6
# File 'lib/you_got_listed/resource.rb', line 4

def client
  @client
end

Instance Method Details

#process_get(path, params = {}, raise_error = false) ⇒ Object



10
11
12
# File 'lib/you_got_listed/resource.rb', line 10

def process_get(path, params = {}, raise_error = false)
  Response.new(self.client.perform_request(:get, path, params), raise_error)
end

#process_post(path, params = {}, raise_error = false) ⇒ Object



14
15
16
# File 'lib/you_got_listed/resource.rb', line 14

def process_post(path, params = {}, raise_error = false)
  Response.new(self.client.perform_request(:post, path, params), raise_error)
end