Class: Cucumber::Messages::RuleChild
- Defined in:
- lib/cucumber/messages/rule_child.rb
Overview
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.
18 19 20 21 22 23 24 25 |
# File 'lib/cucumber/messages/rule_child.rb', line 18 def initialize( background: nil, scenario: nil ) @background = background @scenario = scenario super() end |
Instance Attribute Details
#background ⇒ Object (readonly)
Returns the value of attribute background.
14 15 16 |
# File 'lib/cucumber/messages/rule_child.rb', line 14 def background @background end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
16 17 18 |
# File 'lib/cucumber/messages/rule_child.rb', line 16 def scenario @scenario end |
Class Method Details
.from_h(hash) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/cucumber/messages/rule_child.rb', line 34 def self.from_h(hash) return nil if hash.nil? new( background: Background.from_h(hash[:background]), scenario: Scenario.from_h(hash[:scenario]) ) end |