Class: Y::Actioncable::Config::AbstractBuilder
- Inherits:
-
Object
- Object
- Y::Actioncable::Config::AbstractBuilder
- Defined in:
- lib/y/actioncable/config/abstract_builder.rb
Overview
Abstract base class for y-rb_actioncable and it's extensions configuration builder. Instantiates and validates gem configuration.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#build ⇒ Y::Actioncable::Config
Builds and validates configuration.
-
#initialize(config = Config.new, &block) ⇒ AbstractBuilder
constructor
A new instance of AbstractBuilder.
Constructor Details
#initialize(config = Config.new, &block) ⇒ AbstractBuilder
Returns a new instance of AbstractBuilder.
13 14 15 16 |
# File 'lib/y/actioncable/config/abstract_builder.rb', line 13 def initialize(config = Config.new, &block) @config = config instance_eval(&block) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/y/actioncable/config/abstract_builder.rb', line 9 def config @config end |
Instance Method Details
#build ⇒ Y::Actioncable::Config
Builds and validates configuration.
22 23 24 25 |
# File 'lib/y/actioncable/config/abstract_builder.rb', line 22 def build @config.validate! if @config.respond_to?(:validate!) @config end |