Module: Chaindrive::Gearbox Abstract
- Defined in:
- lib/chaindrive/gearbox.rb,
lib/chaindrive/gearbox/specification.rb
Overview
This module is abstract.
The reproducible definition of a system.
Defined Under Namespace
Classes: Specification
Class Attribute Summary collapse
-
.specifications ⇒ Object
readonly
Returns the value of attribute specifications.
Class Method Summary collapse
-
.define(role = nil, &block) ⇒ Specification
Produce a Gearbox Specification from a block and hash.
Class Attribute Details
.specifications ⇒ Object (readonly)
Returns the value of attribute specifications.
9 10 11 |
# File 'lib/chaindrive/gearbox.rb', line 9 def specifications @specifications end |
Class Method Details
.define(role = nil, &block) ⇒ Specification
Produce a Gearbox Specification from a block and hash.
15 16 17 18 19 20 21 22 |
# File 'lib/chaindrive/gearbox.rb', line 15 def define(role = nil, &block) hash = { role: role.to_s } if role @@specifications ||= [] Hashie::Blash.new(hash).tap do |m| yield m if block_given? return Specification.new(m).tap { |s| @@specifications << s } end end |