Class: TRIPALERTZ::Deal

Inherits:
Object
  • Object
show all
Defined in:
lib/tripalertz/deal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Deal

Returns a new instance of Deal.



7
8
9
10
11
12
13
# File 'lib/tripalertz/deal.rb', line 7

def initialize(args={})
  @auth_login = TRIPALERTZ.
  @auth_key = TRIPALERTZ.auth_key
  @url = TRIPALERTZ.url
  @timeout = TRIPALERTZ.timeout.to_i
  @open_timeout = TRIPALERTZ.open_timeout.to_i
end

Instance Attribute Details

#auth_keyObject

Returns the value of attribute auth_key.



6
7
8
# File 'lib/tripalertz/deal.rb', line 6

def auth_key
  @auth_key
end

#auth_loginObject

Returns the value of attribute auth_login.



6
7
8
# File 'lib/tripalertz/deal.rb', line 6

def 
  @auth_login
end

#open_timeoutObject

Returns the value of attribute open_timeout.



6
7
8
# File 'lib/tripalertz/deal.rb', line 6

def open_timeout
  @open_timeout
end

#timeoutObject

Returns the value of attribute timeout.



6
7
8
# File 'lib/tripalertz/deal.rb', line 6

def timeout
  @timeout
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/tripalertz/deal.rb', line 6

def url
  @url
end

Instance Method Details

#GetCurrentDealsObject



15
16
17
18
# File 'lib/tripalertz/deal.rb', line 15

def GetCurrentDeals()
  @response = RestClient::Request.execute(:method => :get, :url => [@url,'getCurrentDeals'].join, :headers => { :'X-Auth-Login' => '1', :'X-Auth-Key'=> '86f7e437faa5a7fce15d1ddcb9eaeaea377667b8'}, :timeout => @timeout, :open_timeout => @open_timeout)
  puts @response
end