Class: Cucumber::Messages::Scenario

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

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(location: Location.new, tags: [], keyword: '', name: '', description: '', steps: [], examples: [], id: '') ⇒ Scenario

Returns a new instance of Scenario.



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 625

def initialize(
  location: Location.new,
  tags: [],
  keyword: '',
  name: '',
  description: '',
  steps: [],
  examples: [],
  id: ''
)
  @location = location
  @tags = tags
  @keyword = keyword
  @name = name
  @description = description
  @steps = steps
  @examples = examples
  @id = id
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



617
618
619
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 617

def description
  @description
end

#examplesObject (readonly)

Returns the value of attribute examples.



621
622
623
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 621

def examples
  @examples
end

#idObject (readonly)

Returns the value of attribute id.



623
624
625
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 623

def id
  @id
end

#keywordObject (readonly)

Returns the value of attribute keyword.



613
614
615
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 613

def keyword
  @keyword
end

#locationObject (readonly)

The location of the ‘Scenario` keyword



609
610
611
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 609

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



615
616
617
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 615

def name
  @name
end

#stepsObject (readonly)

Returns the value of attribute steps.



619
620
621
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 619

def steps
  @steps
end

#tagsObject (readonly)

Returns the value of attribute tags.



611
612
613
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 611

def tags
  @tags
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 325

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

  self.new(
    location: Location.from_h(hash[:location]),
    tags: hash[:tags]&.map { |item| Tag.from_h(item) },
    keyword: hash[:keyword],
    name: hash[:name],
    description: hash[:description],
    steps: hash[:steps]&.map { |item| Step.from_h(item) },
    examples: hash[:examples]&.map { |item| Examples.from_h(item) },
    id: hash[:id],
  )
end