Module: SportDb::Market

Defined in:
lib/sportdb/market.rb,
lib/sportdb/market/loader.rb,
lib/sportdb/market/reader.rb,
lib/sportdb/market/schema.rb,
lib/sportdb/market/version.rb

Defined Under Namespace

Classes: CreateDb, Deleter, Loader, Reader

Constant Summary collapse

VERSION =
'0.5.1'

Class Method Summary collapse

Class Method Details



20
21
22
# File 'lib/sportdb/market.rb', line 20

def self.banner
  "sportdb-market #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end

.createObject



34
35
36
37
# File 'lib/sportdb/market.rb', line 34

def self.create
  CreateDb.new.up
  # WorldDb::Model::Prop.create!( key: 'db.schema.sport.market.version', value: SportDb::Market::VERSION )
end

.data_pathObject

builtin path to fixture data



30
31
32
# File 'lib/sportdb/market.rb', line 30

def self.data_path
  "#{root}/data"
end

.delete!Object

delete ALL records (use with care!)



69
70
71
72
# File 'lib/sportdb/market.rb', line 69

def self.delete!
  puts '*** deleting sport market table records/data...'
  Deleter.new.run
end

.read_all(include_path) ⇒ Object

convenience helper



45
46
47
# File 'lib/sportdb/market.rb', line 45

def self.read_all( include_path )   # convenience helper
  read_setup( 'setups/all', include_path )
end

.read_setup(setup, include_path) ⇒ Object



40
41
42
43
# File 'lib/sportdb/market.rb', line 40

def self.read_setup( setup, include_path )
  reader = Reader.new( include_path )
  reader.load_setup( setup )
end

.rootObject

cut off folders lib(#1)/sportdb(#2) to get to root



25
26
27
# File 'lib/sportdb/market.rb', line 25

def self.root
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end