module PintrestApi::Authentication

Pintrest Boards this is used to fetch boards and related pins

Constants

EMAIL_INPUT_CSS
LOGIN_PAGE_BUTTON_CSS
PASSWORD_INPUT_CSS
PINTREST_LOGIN_URL

Attributes

is_logged_in[RW]

Public Instance Methods

try_or_check_login(authentication) click to toggle source
# File lib/pintrest_api/authentication.rb, line 11
def try_or_check_login(authentication)
  login authentication if !@is_logged_in && authentication
  @is_logged_in = true
end

Private Instance Methods

login(authentication) click to toggle source
# File lib/pintrest_api/authentication.rb, line 18
def login(authentication)
  visit PINTREST_LOGIN_URL
  @session.find(EMAIL_INPUT_CSS).set authentication[:email]
  @session.find(PASSWORD_INPUT_CSS).set authentication[:password]
  click LOGIN_PAGE_BUTTON_CSS
  puts 'Clicking Login button'
  sleep 5

  puts 'Finished logging in'
end