Class: Bipbip::Storage
- Inherits:
-
Object
- Object
- Bipbip::Storage
- Defined in:
- lib/bipbip/storage.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Copperegg
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, config) ⇒ Storage
constructor
A new instance of Storage.
- #setup_plugin(plugin) ⇒ Object
- #store_sample(plugin, time, data) ⇒ Object
Constructor Details
#initialize(name, config) ⇒ Storage
Returns a new instance of Storage.
13 14 15 16 |
# File 'lib/bipbip/storage.rb', line 13 def initialize(name, config) @name = name.to_s @config = config.to_hash end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
6 7 8 |
# File 'lib/bipbip/storage.rb', line 6 def config @config end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/bipbip/storage.rb', line 5 def name @name end |
Class Method Details
.factory(name, config) ⇒ Object
8 9 10 11 |
# File 'lib/bipbip/storage.rb', line 8 def self.factory(name, config) require "bipbip/storage/#{Bipbip::Helper.name_to_filename(name)}" Storage::const_get(Bipbip::Helper.name_to_classname(name)).new(name, config) end |
Instance Method Details
#setup_plugin(plugin) ⇒ Object
18 19 20 |
# File 'lib/bipbip/storage.rb', line 18 def setup_plugin(plugin) raise 'Missing method setup_plugin' end |
#store_sample(plugin, time, data) ⇒ Object
22 23 24 |
# File 'lib/bipbip/storage.rb', line 22 def store_sample(plugin, time, data) raise 'Missing method store_sample' end |