Module: Knuckles
- Extended by:
- Knuckles
- Included in:
- Knuckles
- Defined in:
- lib/knuckles.rb,
lib/knuckles/view.rb,
lib/knuckles/keygen.rb,
lib/knuckles/version.rb,
lib/knuckles/pipeline.rb,
lib/knuckles/stages/dumper.rb,
lib/knuckles/stages/writer.rb,
lib/knuckles/stages/fetcher.rb,
lib/knuckles/active/hydrator.rb,
lib/knuckles/stages/combiner.rb,
lib/knuckles/stages/enhancer.rb,
lib/knuckles/stages/hydrator.rb,
lib/knuckles/stages/renderer.rb
Overview
Knuckles is a performance focused data serialization pipeline. More simply, it tries to serialize models into large JSON payloads as quickly as possible. It operates on a collection of data through stages, passing them through a pipeline of transformations.
The default configuration uses ‘MemoryStore`, but you can configure it along with other customizations.
With the module configured you can begin transforming models into JSON (or MessagePack, whatever your API uses):
Defined Under Namespace
Modules: Active, Keygen, Stages, View Classes: Pipeline
Constant Summary collapse
- VERSION =
The current version of Knuckles
"0.5.0"
Instance Attribute Summary collapse
-
#cache ⇒ #cache
Module accessor for ‘cache`, defaults to `Cache::MemoryStore`.
-
#keygen ⇒ Module
Module accessor ‘keygen`, defaults to `Knuckles::Keygen`.
-
#notifications ⇒ Module
Module accessor for ‘notifications`, defaults to `ActiveSupport::Notifications`.
-
#serializer ⇒ Module
Module accessor for ‘serializer`, defaults to `JSON`.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience for setting properties as within a block.
-
#new(*args) ⇒ Object
Convenience method for initializing a new ‘Pipeline`.
-
#reset! ⇒ Object
Reset all configuration values back to ‘nil`, restoring them to the defaults.
Instance Attribute Details
#cache ⇒ #cache
Module accessor for ‘cache`, defaults to `Cache::MemoryStore`
69 70 71 |
# File 'lib/knuckles.rb', line 69 def cache @cache ||= ActiveSupport::Cache::MemoryStore.new end |
#keygen ⇒ Module
Module accessor ‘keygen`, defaults to `Knuckles::Keygen`
77 78 79 |
# File 'lib/knuckles.rb', line 77 def keygen @keygen ||= Knuckles::Keygen end |
#notifications ⇒ Module
Module accessor for ‘notifications`, defaults to `ActiveSupport::Notifications`
86 87 88 |
# File 'lib/knuckles.rb', line 86 def notifications @notifications ||= ActiveSupport::Notifications end |
#serializer ⇒ Module
Module accessor for ‘serializer`, defaults to `JSON`
94 95 96 |
# File 'lib/knuckles.rb', line 94 def serializer @serializer ||= JSON end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience for setting properties as within a block
106 107 108 |
# File 'lib/knuckles.rb', line 106 def configure yield self end |
#new(*args) ⇒ Object
Convenience method for initializing a new ‘Pipeline`
61 62 63 |
# File 'lib/knuckles.rb', line 61 def new(*args) Knuckles::Pipeline.new(*args) end |
#reset! ⇒ Object
Reset all configuration values back to ‘nil`, restoring them to the defaults. This is useful for testing because configuration is global.
112 113 114 115 116 117 |
# File 'lib/knuckles.rb', line 112 def reset! @cache = nil @keygen = nil @notifications = nil @serializer = nil end |