Class: KindleNotebook::Client
- Inherits:
-
Object
- Object
- KindleNotebook::Client
- Defined in:
- lib/kindle_notebook/client.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #books ⇒ Object
-
#initialize(email: KindleNotebook.configuration.login, password: KindleNotebook.configuration.password, headless_mode: KindleNotebook.configuration.headless_mode, selenium_driver: KindleNotebook.configuration.selenium_driver) ⇒ Client
constructor
A new instance of Client.
- #sign_in ⇒ Object
Constructor Details
#initialize(email: KindleNotebook.configuration.login, password: KindleNotebook.configuration.password, headless_mode: KindleNotebook.configuration.headless_mode, selenium_driver: KindleNotebook.configuration.selenium_driver) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/kindle_notebook/client.rb', line 7 def initialize(email: KindleNotebook.configuration.login, password: KindleNotebook.configuration.password, headless_mode: KindleNotebook.configuration.headless_mode, selenium_driver: KindleNotebook.configuration.selenium_driver) @email = email @password = password @headless_mode = headless_mode @selenium_driver = selenium_driver.to_sym @session = end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
5 6 7 |
# File 'lib/kindle_notebook/client.rb', line 5 def session @session end |
Instance Method Details
#books ⇒ Object
18 19 20 |
# File 'lib/kindle_notebook/client.rb', line 18 def books @books ||= fetch_books end |
#sign_in ⇒ Object
22 23 24 |
# File 'lib/kindle_notebook/client.rb', line 22 def sign_in AmazonAuth.new(password: password, email: email).sign_in end |