Class: ARBookFinder::UserTypeProcessor

Inherits:
Object
  • Object
show all
Includes:
Capybara::DSL
Defined in:
lib/ar_book_finder/user_type_processor.rb

Constant Summary collapse

USER_TYPE_URL =
"#{ARBookFinder::BASE_URL}/usertype.aspx"
USER_TYPES =
{
  student: 'Student',
  parent: 'Parent',
  teacher: 'Teacher',
  librarian: 'Librarian'
}

Instance Method Summary collapse

Constructor Details

#initialize(user_type) ⇒ UserTypeProcessor

Returns a new instance of UserTypeProcessor.



14
15
16
# File 'lib/ar_book_finder/user_type_processor.rb', line 14

def initialize(user_type)
  @user_type = USER_TYPES[user_type]
end

Instance Method Details

#processObject



18
19
20
21
22
# File 'lib/ar_book_finder/user_type_processor.rb', line 18

def process
  visit(USER_TYPE_URL)
  choose(@user_type)
  click_button('Submit')
end