Class: Cucumber::Messages::RuleChild
- Defined in:
- lib/cucumber/messages/rule_child.rb
Overview
Represents the RuleChild message in Cucumber’s message protocol.
A child node of a ‘Rule` node
Instance Attribute Summary collapse
-
#background ⇒ Object
readonly
Returns the value of attribute background.
-
#scenario ⇒ Object
readonly
Returns the value of attribute scenario.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new RuleChild from the given hash.
Instance Method Summary collapse
-
#initialize(background: nil, scenario: nil) ⇒ RuleChild
constructor
A new instance of RuleChild.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(background: nil, scenario: nil) ⇒ RuleChild
Returns a new instance of RuleChild.
17 18 19 20 21 22 23 24 |
# File 'lib/cucumber/messages/rule_child.rb', line 17 def initialize( background: nil, scenario: nil ) @background = background @scenario = scenario super() end |
Instance Attribute Details
#background ⇒ Object (readonly)
Returns the value of attribute background.
13 14 15 |
# File 'lib/cucumber/messages/rule_child.rb', line 13 def background @background end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
15 16 17 |
# File 'lib/cucumber/messages/rule_child.rb', line 15 def scenario @scenario end |
Class Method Details
.from_h(hash) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/cucumber/messages/rule_child.rb', line 33 def self.from_h(hash) return nil if hash.nil? new( background: Background.from_h(hash[:background]), scenario: Scenario.from_h(hash[:scenario]) ) end |