Class: LaterPaper

Inherits:
Object
  • Object
show all
Defined in:
lib/laterpaper.rb

Instance Method Summary collapse

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

Returns:

  • (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

Returns:

  • (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_codeObject



25
26
27
# File 'lib/laterpaper.rb', line 25

def return_code
  @return_code
end