Class: CoinSync::Importers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/coinsync/importers/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, params = {}) ⇒ Base

Returns a new instance of Base.



25
26
27
28
# File 'lib/coinsync/importers/base.rb', line 25

def initialize(config, params = {})
  @config = config
  @params = params
end

Class Method Details

.register_commands(*commands) ⇒ Object



16
17
18
19
# File 'lib/coinsync/importers/base.rb', line 16

def self.register_commands(*commands)
  @commands ||= []
  @commands += commands.map(&:to_sym)
end

.register_importer(key) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/coinsync/importers/base.rb', line 8

def self.register_importer(key)
  if Importers.registered[key]
    raise "Importer has already been registered at '#{key}'"
  else
    Importers.registered[key] = self
  end
end

.registered_commandsObject



21
22
23
# File 'lib/coinsync/importers/base.rb', line 21

def self.registered_commands
  @commands || []
end

Instance Method Details

#can_build?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/coinsync/importers/base.rb', line 30

def can_build?
  true
end