Class: Grackle::Client::Request
- Inherits:
-
Object
- Object
- Grackle::Client::Request
- Defined in:
- lib/grackle/client.rb
Overview
:nodoc:
Instance Attribute Summary (collapse)
-
- (Object) api
Returns the value of attribute api.
-
- (Object) client
Returns the value of attribute client.
-
- (Object) method
Returns the value of attribute method.
-
- (Object) params
Returns the value of attribute params.
-
- (Object) path
Returns the value of attribute path.
-
- (Object) ssl
Returns the value of attribute ssl.
Instance Method Summary (collapse)
- - (Object) <<(path)
- - (Object) host
-
- (Request) initialize(client, api = :rest, ssl = true)
constructor
A new instance of Request.
- - (Boolean) path?
- - (Object) scheme
- - (Object) url
Constructor Details
- (Request) initialize(client, api = :rest, ssl = true)
A new instance of Request
50 51 52 53 54 55 |
# File 'lib/grackle/client.rb', line 50 def initialize(client,api=:rest,ssl=true) self.client = client self.api = api self.ssl = ssl self.path = '' end |
Instance Attribute Details
- (Object) api
Returns the value of attribute api
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def api @api end |
- (Object) client
Returns the value of attribute client
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def client @client end |
- (Object) method
Returns the value of attribute method
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def method @method end |
- (Object) params
Returns the value of attribute params
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def params @params ||= {} end |
- (Object) path
Returns the value of attribute path
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def path @path end |
- (Object) ssl
Returns the value of attribute ssl
48 49 50 |
# File 'lib/grackle/client.rb', line 48 def ssl @ssl end |
Instance Method Details
- (Object) <<(path)
57 58 59 |
# File 'lib/grackle/client.rb', line 57 def <<(path) self.path << path end |
- (Object) host
69 70 71 |
# File 'lib/grackle/client.rb', line 69 def host client.api_hosts[api] end |
- (Boolean) path?
61 62 63 |
# File 'lib/grackle/client.rb', line 61 def path? path.length > 0 end |
- (Object) scheme
73 74 75 |
# File 'lib/grackle/client.rb', line 73 def scheme ssl ? 'https' :'http' end |
- (Object) url
65 66 67 |
# File 'lib/grackle/client.rb', line 65 def url "#{scheme}://#{host}#{path}" end |