Module: Chassis

Defined in:
lib/chassis.rb,
lib/chassis/repo.rb,
lib/chassis/error.rb,
lib/chassis/logger.rb,
lib/chassis/version.rb,
lib/chassis/delegate.rb,
lib/chassis/hash_utils.rb,
lib/chassis/array_utils.rb,
lib/chassis/persistence.rb,
lib/chassis/string_utils.rb,
lib/chassis/initializable.rb,
lib/chassis/repo/base_repo.rb,
lib/chassis/repo/null_repo.rb,
lib/chassis/repo/delegation.rb,
lib/chassis/repo/record_map.rb,
lib/chassis/repo/maglev_repo.rb,
lib/chassis/repo/memory_repo.rb

Defined Under Namespace

Modules: ArrayUtils, HashUtils, Persistence, StringUtils Classes: BaseRepo, Delegation, Logger, MaglevRepo, MemoryRepo, NullRepo, Repo

Constant Summary collapse

Proxy =
Prox
RecordNotFoundError =
Chassis.error do |klass, id|
  "Could not locate #{klass} with id #{id}"
end
QueryNotImplementedError =
Chassis.error do |selector|
  "Adapter does not support #{selector.class}!"
end
GraphQueryNotImplementedError =
Chassis.error do |selector|
  "Adapter does not know how to graph #{selector.class}!"
end
NoQueryResultError =
Chassis.error do |selector|
  "Query #{selector.class} must return results!"
end
VERSION =
"0.1.0"
DelegationError =
Chassis.error do |method, delegate|
  "Cannot delegate #{method} without #{delegate}"
end
Initializable =
::Lift
UnknownObjectClassError =
Chassis.error do
  "Rename class to end in Repo or define object_class"
end

Class Method Summary collapse

Class Method Details

.delegate(*methods) ⇒ Object



25
26
27
# File 'lib/chassis/delegate.rb', line 25

def delegate(*methods)
  Delegation.new *methods
end

.error(*args, &block) ⇒ Object



3
4
5
# File 'lib/chassis/error.rb', line 3

def error(*args, &block)
  Tnt.boom *args, &block
end

.repoObject



60
61
62
# File 'lib/chassis/repo.rb', line 60

def repo
  Repo.default
end

.streamObject



12
13
14
# File 'lib/chassis.rb', line 12

def stream
  @stream
end

.stream=(stream) ⇒ Object



16
17
18
# File 'lib/chassis.rb', line 16

def stream=(stream)
  @stream = stream
end