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.
9 10 11 12 |
# File 'lib/ulule.rb', line 9 def initialize(username, apikey) @username = username @apikey = apikey end |
Instance Attribute Details
#apikey ⇒ Object
Returns the value of attribute apikey.
7 8 9 |
# File 'lib/ulule.rb', line 7 def apikey @apikey end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/ulule.rb', line 6 def username @username end |
Instance Method Details
#project(url) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ulule.rb', line 14 def project(url) if (name = url.match(/.*\/(.*)\/$/)).nil? return puts "Wrong url !" end output = send_request name[1] if output.empty? return puts "Wrong username/apikey or url !" end JSON.parse(output) end |