Module: UbigeoRails

Extended by:
UbigeoRails
Included in:
UbigeoRails
Defined in:
lib/dsl.rb,
lib/engine.rb,
lib/seeder.rb,
app/models/ubigeo_rails/ubigeo.rb,
lib/generators/ubigeo_rails/seeds_generator.rb,
lib/generators/ubigeo_rails/install_generator.rb,
app/controllers/ubigeo_rails/ubigeos_controller.rb

Defined Under Namespace

Modules: Generators, Seeds Classes: DSLConfig, Engine, Ubigeo, UbigeosController

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#db_connection_procObject

Returns the value of attribute db_connection_proc.



5
6
7
# File 'lib/dsl.rb', line 5

def db_connection_proc
  @db_connection_proc
end

#table_nameObject

Returns the value of attribute table_name.



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

def table_name
  @table_name
end

Instance Method Details

#config {|dsl_config| ... } ⇒ Object

Yields:

  • (dsl_config)


7
8
9
10
# File 'lib/dsl.rb', line 7

def config
  dsl_config = DSLConfig.new
  yield dsl_config
end

#seed_db!Object



6
7
8
9
10
11
12
# File 'lib/seeder.rb', line 6

def seed_db!
  if Ubigeo.empty?
    Seeds::DATA.each do |ubigeo_data|
      Ubigeo.create(ubigeo_data)
    end
  end
end