Class: LaterPaper
- Inherits:
-
Object
- Object
- LaterPaper
- Defined in:
- lib/laterpaper.rb
Instance Method Summary collapse
- #add(url) ⇒ Object
- #add?(url) ⇒ Boolean
- #check_authentication? ⇒ Boolean
-
#initialize(username, password) ⇒ LaterPaper
constructor
A new instance of LaterPaper.
- #return_code ⇒ Object
Constructor Details
#initialize(username, password) ⇒ LaterPaper
Returns a new instance of LaterPaper.
5 6 7 8 9 |
# File 'lib/laterpaper.rb', line 5 def initialize(username, password) @username = username @password = password @return_code = 0 end |
Instance Method Details
#add(url) ⇒ Object
16 17 18 |
# File 'lib/laterpaper.rb', line 16 def add(url) add?(url) end |
#add?(url) ⇒ Boolean
20 21 22 23 |
# File 'lib/laterpaper.rb', line 20 def add?(url) execute_url_command(auth_url("add") << "&url=#{url}") return ( @return_code == "201" ) end |
#check_authentication? ⇒ Boolean
11 12 13 14 |
# File 'lib/laterpaper.rb', line 11 def check_authentication? execute_url_command(auth_url('authenticate')) return ( @return_code == "200" ) end |
#return_code ⇒ Object
25 26 27 |
# File 'lib/laterpaper.rb', line 25 def return_code @return_code end |