Class: Cucumber::Messages::FeatureChild

Inherits:
Message show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb

Overview

Represents the FeatureChild message in Cucumber’s message protocol.

*

A child node of a `Feature` node

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(rule: nil, background: nil, scenario: nil) ⇒ FeatureChild

Returns a new instance of FeatureChild.



515
516
517
518
519
520
521
522
523
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 515

def initialize(
  rule: nil,
  background: nil,
  scenario: nil
)
  @rule = rule
  @background = background
  @scenario = scenario
end

Instance Attribute Details

#backgroundObject (readonly)

Returns the value of attribute background.



511
512
513
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 511

def background
  @background
end

#ruleObject (readonly)

Returns the value of attribute rule.



509
510
511
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 509

def rule
  @rule
end

#scenarioObject (readonly)

Returns the value of attribute scenario.



513
514
515
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 513

def scenario
  @scenario
end

Class Method Details

.from_h(hash) ⇒ Object

Returns a new FeatureChild from the given hash. If the hash keys are camelCased, they are properly assigned to the corresponding snake_cased attributes.

Cucumber::Messages::FeatureChild.from_h(some_hash) # => #<Cucumber::Messages::FeatureChild:0x... ...>


259
260
261
262
263
264
265
266
267
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 259

def self.from_h(hash)
  return nil if hash.nil?

  self.new(
    rule: Rule.from_h(hash[:rule]),
    background: Background.from_h(hash[:background]),
    scenario: Scenario.from_h(hash[:scenario]),
  )
end