Class: Tixriss::Request
- Inherits:
-
Object
- Object
- Tixriss::Request
- Defined in:
- lib/tixriss/request.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(domain: nil, key: nil) ⇒ Request
constructor
A new instance of Request.
- #parameters ⇒ Object
- #response ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(domain: nil, key: nil) ⇒ Request
Returns a new instance of Request.
7 8 9 |
# File 'lib/tixriss/request.rb', line 7 def initialize(domain: nil, key: nil) @domain, @key = domain, key end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
5 6 7 |
# File 'lib/tixriss/request.rb', line 5 def domain @domain end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/tixriss/request.rb', line 5 def key @key end |
Instance Method Details
#get ⇒ Object
15 16 17 |
# File 'lib/tixriss/request.rb', line 15 def get Net::HTTP.get uri end |
#parameters ⇒ Object
23 24 25 |
# File 'lib/tixriss/request.rb', line 23 def parameters "api_key=#{key}&domain=#{domain}" end |
#response ⇒ Object
11 12 13 |
# File 'lib/tixriss/request.rb', line 11 def response @response ||= get end |
#uri ⇒ Object
19 20 21 |
# File 'lib/tixriss/request.rb', line 19 def uri @uri ||= URI("http://api.sistrix.net/links.list?#{parameters}") end |