Class: Hypercuke::AdapterDefinition::TopicBuilder
- Inherits:
-
Object
- Object
- Hypercuke::AdapterDefinition::TopicBuilder
- Defined in:
- lib/hypercuke/adapter_definition.rb
Instance Attribute Summary collapse
-
#topic_name ⇒ Object
readonly
Returns the value of attribute topic_name.
Instance Method Summary collapse
-
#initialize(topic_name) ⇒ TopicBuilder
constructor
A new instance of TopicBuilder.
-
#layer(layer_name, &block) ⇒ Object
I know the name says “layer”, but what it means is that we should define a step adapter for that layer.
Constructor Details
#initialize(topic_name) ⇒ TopicBuilder
Returns a new instance of TopicBuilder.
16 17 18 |
# File 'lib/hypercuke/adapter_definition.rb', line 16 def initialize(topic_name) @topic_name = topic_name.to_sym end |
Instance Attribute Details
#topic_name ⇒ Object (readonly)
Returns the value of attribute topic_name.
15 16 17 |
# File 'lib/hypercuke/adapter_definition.rb', line 15 def topic_name @topic_name end |
Instance Method Details
#layer(layer_name, &block) ⇒ Object
I know the name says “layer”, but what it means is that we should define a step adapter for that layer.
22 23 24 25 26 |
# File 'lib/hypercuke/adapter_definition.rb', line 22 def layer(layer_name, &block) Hypercuke.layers.define layer_name klass = Hypercuke::StepAdapters.define( topic_name, layer_name ) klass.module_eval &block if block_given? end |