Module: PicoApi

Defined in:
lib/pico_api.rb,
lib/pico_api/version.rb,
lib/pico_api/database.rb,
lib/pico_api/configuration.rb,
lib/pico_api/entities/error.rb,
lib/pico_api/entities/errors.rb,
lib/pico_api/handlers/errors.rb,
lib/pico_api/serializers/base.rb,
lib/pico_api/json_api_renderer.rb,
lib/pico_api/generators/generator.rb,
lib/pico_api/generators/file_copier.rb,
lib/pico_api/generators/file_creator.rb,
lib/pico_api/generators/commands/create_gemfile.rb,
lib/pico_api/generators/commands/create_rakefile.rb,
lib/pico_api/generators/project_name_data_mapper.rb,
lib/pico_api/generators/commands/create_config_ru.rb,
lib/pico_api/generators/commands/create_gitignore.rb,
lib/pico_api/generators/commands/create_config_boot.rb,
lib/pico_api/generators/commands/create_config_dotenv.rb,
lib/pico_api/generators/commands/create_basic_structure.rb,
lib/pico_api/generators/commands/create_config_application.rb,
lib/pico_api/generators/commands/create_config_database_yml.rb,
lib/pico_api/generators/commands/create_config_configuration.rb,
lib/pico_api/generators/commands/create_config_database_setup.rb

Defined Under Namespace

Modules: Entities, Generators, Handlers, JsonApiRenderer, Serializers Classes: Application, Configuration, Database

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.configurationObject



8
9
10
# File 'lib/pico_api/configuration.rb', line 8

def configuration
  @configuration ||= Configuration.new(db_config)
end

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/pico_api/configuration.rb', line 17

def configure
  yield(configuration)
end

.db_configObject



12
13
14
15
# File 'lib/pico_api/configuration.rb', line 12

def db_config
  template = ERB.new(File.new('./config/database.yml').read)
  YAML.safe_load(template.result(binding))
end

.lib_pathObject



14
15
16
# File 'lib/pico_api.rb', line 14

def self.lib_path
  File.join(root_path, 'lib/pico_api')
end

.root_pathObject



10
11
12
# File 'lib/pico_api.rb', line 10

def self.root_path
  File.dirname(__dir__)
end