Class: BrowsingHistory::Storages::Base
- Inherits:
-
Object
- Object
- BrowsingHistory::Storages::Base
- Defined in:
- lib/browsing_history/storages/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#historizable ⇒ Object
Returns the value of attribute historizable.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(browser, historizable) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize(browser, historizable) ⇒ Base
Returns a new instance of Base.
9 10 11 12 |
# File 'lib/browsing_history/storages/base.rb', line 9 def initialize(browser, historizable) @browser = browser @historizable = historizable end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/browsing_history/storages/base.rb', line 14 def method_missing(method, *args) if method.in?(IOMethods) raise NotOverideError else super end end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
7 8 9 |
# File 'lib/browsing_history/storages/base.rb', line 7 def browser @browser end |
#historizable ⇒ Object
Returns the value of attribute historizable.
7 8 9 |
# File 'lib/browsing_history/storages/base.rb', line 7 def historizable @historizable end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/browsing_history/storages/base.rb', line 7 def @options end |
Class Method Details
.connect ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/browsing_history/storages/base.rb', line 23 def connect IOMethods.each do |method| define_singleton_method(method) do |browser, historizable, *_args| opts = _args.dup..merge() new(browser, historizable).send(method, **opts) end end end |
.default_options ⇒ Object
32 33 34 |
# File 'lib/browsing_history/storages/base.rb', line 32 def {} end |