Class: Rlaunchpadlib::Client
- Inherits:
-
Object
- Object
- Rlaunchpadlib::Client
- Includes:
- HTTParty
- Defined in:
- lib/rlaunchpadlib/client.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
Instance Method Summary collapse
- #get(scope, operation = "") ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
11 12 13 14 |
# File 'lib/rlaunchpadlib/client.rb', line 11 def initialize() @base_uri = "https://api.launchpad.net" @api_version = "1.0" end |
Instance Attribute Details
#api_version ⇒ Object
Returns the value of attribute api_version.
9 10 11 |
# File 'lib/rlaunchpadlib/client.rb', line 9 def api_version @api_version end |
#base_uri ⇒ Object
Returns the value of attribute base_uri.
8 9 10 |
# File 'lib/rlaunchpadlib/client.rb', line 8 def base_uri @base_uri end |
Instance Method Details
#get(scope, operation = "") ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rlaunchpadlib/client.rb', line 16 def get(scope, operation="") if operation.empty? result = self.class.get "#{@base_uri}/#{@api_version}/#{scope}" result.to_hash() else result = self.class.get "#{@base_uri}/#{@api_version}/#{scope}/?ws.op=#{operation}" result.to_hash() end end |