Class: Cucumber::Messages::Group

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(children: [], start: nil, value: nil) ⇒ Group

Returns a new instance of Group.



1515
1516
1517
1518
1519
1520
1521
1522
1523
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1515

def initialize(
  children: [],
  start: nil,
  value: nil
)
  @children = children
  @start = start
  @value = value
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



1509
1510
1511
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1509

def children
  @children
end

#startObject (readonly)

Returns the value of attribute start.



1511
1512
1513
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1511

def start
  @start
end

#valueObject (readonly)

Returns the value of attribute value.



1513
1514
1515
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 1513

def value
  @value
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


921
922
923
924
925
926
927
928
929
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 921

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

  self.new(
    children: hash[:children]&.map { |item| Group.from_h(item) },
    start: hash[:start],
    value: hash[:value],
  )
end