Class: KindleManager::BaseAdapter
- Inherits:
-
Object
- Object
- KindleManager::BaseAdapter
- Includes:
- AmazonAuth::CommonExtension
- Defined in:
- lib/kindle_manager/adapters/base_adapter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#session ⇒ Object
Returns the value of attribute session.
-
#store ⇒ Object
Returns the value of attribute store.
Instance Method Summary collapse
-
#initialize(options) ⇒ BaseAdapter
constructor
A new instance of BaseAdapter.
- #limit ⇒ Object
- #max_scroll_attempts ⇒ Object
Constructor Details
#initialize(options) ⇒ BaseAdapter
Returns a new instance of BaseAdapter.
7 8 9 10 11 12 13 14 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 7 def initialize() @options = @session = .fetch(:session, nil) extend(AmazonAuth::SessionExtension) @store = KindleManager::FileStore.new(.merge(session: @session)) log "Directory for downloaded pages is #{store.target_dir}" end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 5 def @options end |
#session ⇒ Object
Returns the value of attribute session.
5 6 7 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 5 def session @session end |
#store ⇒ Object
Returns the value of attribute store.
5 6 7 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 5 def store @store end |
Instance Method Details
#limit ⇒ Object
16 17 18 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 16 def limit .fetch(:limit, nil) end |
#max_scroll_attempts ⇒ Object
20 21 22 |
# File 'lib/kindle_manager/adapters/base_adapter.rb', line 20 def max_scroll_attempts .fetch(:max_scroll_attempts, 20) end |