Class: Fix::Builder Private
- Inherits:
-
Object
- Object
- Fix::Builder
- Defined in:
- lib/fix/builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Handles the creation and setup of Fix specifications.
The Builder constructs new Fix specification sets following these steps:
-
Creates a new specification class inheriting from DSL
-
Defines the specification content using the provided block
-
Optionally registers the named specification
-
Returns the built specification set
Instance Attribute Summary collapse
-
#name ⇒ String, ...
readonly
private
The name of the specification.
Class Method Summary collapse
-
.build(name = nil) {|Block| ... } ⇒ Fix::Set
private
Creates a new specification set.
Instance Method Summary collapse
-
#construct_set ⇒ Fix::Set
private
Constructs and returns a new specification set.
-
#initialize(name = nil, &block) ⇒ Builder
constructor
private
A new instance of Builder.
Constructor Details
#initialize(name = nil, &block) ⇒ Builder
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Builder.
46 47 48 49 50 51 |
# File 'lib/fix/builder.rb', line 46 def initialize(name = nil, &block) raise Error::MissingSpecificationBlock unless block @name = name @block = block end |
Instance Attribute Details
#name ⇒ String, ... (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The name of the specification.
44 45 46 |
# File 'lib/fix/builder.rb', line 44 def name @name end |
Class Method Details
.build(name = nil) {|Block| ... } ⇒ Fix::Set
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new specification set.
39 40 41 |
# File 'lib/fix/builder.rb', line 39 def self.build(name = nil, &block) new(name, &block).construct_set end |
Instance Method Details
#construct_set ⇒ Fix::Set
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Constructs and returns a new specification set.
56 57 58 59 60 61 |
# File 'lib/fix/builder.rb', line 56 def construct_set klass = create_specification populate_specification(klass) register_if_named(klass) build_set(klass) end |