Class: Ulule
- Inherits:
-
Object
- Object
- Ulule
- Defined in:
- lib/ulule.rb
Instance Attribute Summary collapse
-
#apikey ⇒ Object
Returns the value of attribute apikey.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(username, apikey) ⇒ Ulule
constructor
A new instance of Ulule.
- #project(url) ⇒ Object
Constructor Details
#initialize(username, apikey) ⇒ Ulule
Returns a new instance of Ulule.
11 12 13 |
# File 'lib/ulule.rb', line 11 def initialize(username, apikey) @username, @apikey = username, apikey end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
9 10 11 |
# File 'lib/ulule.rb', line 9 def apikey @apikey end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/ulule.rb', line 8 def username @username end |
Instance Method Details
#project(url) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/ulule.rb', line 15 def project url raise UluleError, "Wrong url" if (name = url.match(/.*\/(.*)\/$/)).nil? output = send_request name[1] raise UluleError "Wrong username/apikey or url" if output.empty? JSON.parse output end |