Module: Get

Extended by:
Configuration
Defined in:
lib/get.rb,
lib/get/db.rb,
lib/get/errors.rb,
lib/get/parser.rb,
lib/get/builders.rb,
lib/get/run_methods.rb,
lib/get/configuration.rb,
lib/get/builders/base_builder.rb,
lib/get/builders/join_builder.rb,
lib/get/builders/query_builder.rb,
lib/get/builders/ancestry_builder.rb

Defined Under Namespace

Modules: Builders, Configuration, Errors, RunMethods Classes: Config, Db, Parser

Constant Summary collapse

GET_CLASS_REGEX =
/^(.*)(By|From)(.*)/

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Configuration

adapter, configuration, configure, reset

Class Attribute Details

.configuration=(value) ⇒ Object (writeonly)

Sets the attribute configuration

Parameters:

  • value

    the value to set the attribute configuration to.


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

def configuration=(value)
  @configuration = value
end

Class Method Details

.const_missing(name) ⇒ Object


27
28
29
30
31
# File 'lib/get.rb', line 27

def const_missing(name)
  parser = ::Get::Parser.new(name)
  return super(name) unless parser.match?
  Builders.generate_class(name, parser.method)
end

.included(base) ⇒ Object


21
22
23
24
25
# File 'lib/get.rb', line 21

def included(base)
  base.class_eval do
    extend ::Get::RunMethods
  end
end

Instance Method Details

#runObject


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

def run
  run!
rescue ::Get::Errors::Base, Get::Errors::RecordNotFound
end

#run!Object


39
40
41
42
43
# File 'lib/get.rb', line 39

def run!
  call
rescue *Get.adapter.expected_horza_errors => e
  raise ::Get::Errors::Base.new(e.message)
end