Module: Mancora

Extended by:
Mancora
Included in:
Mancora
Defined in:
lib/mancora.rb,
lib/mancora/stat.rb,
lib/mancora/railtie.rb,
lib/mancora/version.rb,
lib/generators/mancora/install/install_generator.rb

Defined Under Namespace

Modules: Generators Classes: Railtie, Stat

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(backfill = 0) ⇒ Object



13
14
15
16
17
# File 'lib/mancora.rb', line 13

def self.run(backfill = 0)
  @backfill = backfill
  puts "Backfilling " + (@backfill || 0).to_s  + " hours." if @backfill > 0
  load Rails.root.join('lib', 'mancora.rb')
end

.table_name_prefixObject



9
10
11
# File 'lib/mancora.rb', line 9

def self.table_name_prefix
  'mancora_'
end

Instance Method Details

#widget(opt, options = {}, &block) ⇒ Object



23
24
25
# File 'lib/mancora.rb', line 23

def widget(opt, options = {}, &block)
  Widget.new(opt, @backfill, &block)
end

#widgets(hash = {}, &block) ⇒ Object



19
20
21
# File 'lib/mancora.rb', line 19

def widgets(hash = {}, &block)  
  instance_eval(&block) if block_given?
end