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.
5 6 7 |
# File 'lib/tixriss/request.rb', line 5 def initialize(domain: nil, key: nil) @domain, @key = domain, key end |
Instance Attribute Details
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
3 4 5 |
# File 'lib/tixriss/request.rb', line 3 def domain @domain end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/tixriss/request.rb', line 3 def key @key end |
Instance Method Details
#get ⇒ Object
13 14 15 |
# File 'lib/tixriss/request.rb', line 13 def get Net::HTTP.get uri end |
#parameters ⇒ Object
21 22 23 |
# File 'lib/tixriss/request.rb', line 21 def parameters "api_key=#{key}&domain=#{domain}" end |
#response ⇒ Object
9 10 11 |
# File 'lib/tixriss/request.rb', line 9 def response @response ||= get end |
#uri ⇒ Object
17 18 19 |
# File 'lib/tixriss/request.rb', line 17 def uri @uri ||= URI("http://api.sistrix.net/links.list?#{parameters}") end |