Class: TRIPALERTZ::Deal
- Inherits:
-
Object
- Object
- TRIPALERTZ::Deal
- Defined in:
- lib/tripalertz/deal.rb
Instance Attribute Summary collapse
-
#auth_key ⇒ Object
Returns the value of attribute auth_key.
-
#auth_login ⇒ Object
Returns the value of attribute auth_login.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #GetCurrentDeals ⇒ Object
-
#initialize(args = {}) ⇒ Deal
constructor
A new instance of Deal.
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_login @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_key ⇒ Object
Returns the value of attribute auth_key.
6 7 8 |
# File 'lib/tripalertz/deal.rb', line 6 def auth_key @auth_key end |
#auth_login ⇒ Object
Returns the value of attribute auth_login.
6 7 8 |
# File 'lib/tripalertz/deal.rb', line 6 def auth_login @auth_login end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
6 7 8 |
# File 'lib/tripalertz/deal.rb', line 6 def open_timeout @open_timeout end |
#timeout ⇒ Object
Returns the value of attribute timeout.
6 7 8 |
# File 'lib/tripalertz/deal.rb', line 6 def timeout @timeout end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/tripalertz/deal.rb', line 6 def url @url end |
Instance Method Details
#GetCurrentDeals ⇒ Object
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 |