Class: Cucumber::Messages::Examples

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: '', table_header: nil, table_body: [], id: '') ⇒ Examples

Returns a new instance of Examples.



415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 415

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

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



407
408
409
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 407

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



413
414
415
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 413

def id
  @id
end

#keywordObject (readonly)

Returns the value of attribute keyword.



403
404
405
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 403

def keyword
  @keyword
end

#locationObject (readonly)

The location of the ‘Examples` keyword



399
400
401
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 399

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



405
406
407
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 405

def name
  @name
end

#table_bodyObject (readonly)

Returns the value of attribute table_body.



411
412
413
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 411

def table_body
  @table_body
end

#table_headerObject (readonly)

Returns the value of attribute table_header.



409
410
411
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 409

def table_header
  @table_header
end

#tagsObject (readonly)

Returns the value of attribute tags.



401
402
403
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 401

def tags
  @tags
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 208

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],
    table_header: TableRow.from_h(hash[:tableHeader]),
    table_body: hash[:tableBody]&.map { |item| TableRow.from_h(item) },
    id: hash[:id],
  )
end