Class: Bipbip::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/bipbip/storage.rb

Direct Known Subclasses

Copperegg

Defined Under Namespace

Classes: Copperegg

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, config) ⇒ Storage

Returns a new instance of Storage.



11
12
13
14
# File 'lib/bipbip/storage.rb', line 11

def initialize(name, config)
  @name = name.to_s
  @config = config.to_hash
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



4
5
6
# File 'lib/bipbip/storage.rb', line 4

def config
  @config
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/bipbip/storage.rb', line 3

def name
  @name
end

Class Method Details

.factory(name, config) ⇒ Object



6
7
8
9
# File 'lib/bipbip/storage.rb', line 6

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



16
17
18
# File 'lib/bipbip/storage.rb', line 16

def setup_plugin(_plugin)
  raise 'Missing method setup_plugin'
end

#store_sample(_plugin, _time, _data) ⇒ Object



20
21
22
# File 'lib/bipbip/storage.rb', line 20

def store_sample(_plugin, _time, _data)
  raise 'Missing method store_sample'
end