class Cucumber::Messages::Feature

Attributes

children[R]

Zero or more children

description[R]

The line(s) underneath the line with the ‘keyword` that are used as description

keyword[R]

The text of the ‘Feature` keyword (in the language specified by `language`)

language[R]

The [ISO 639-1](en.wikipedia.org/wiki/ISO_639-1) language code of the Gherkin document

location[R]

The location of the ‘Feature` keyword

name[R]

The name of the feature (the text following the ‘keyword`)

tags[R]

All the tags placed above the ‘Feature` keyword

Public Class Methods

from_h(hash) click to toggle source

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

Cucumber::Messages::Feature.from_h(some_hash) # => #<Cucumber::Messages::Feature:0x... ...>
# File lib/cucumber/messages.deserializers.rb, line 254
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) },
    language: hash[:language],
    keyword: hash[:keyword],
    name: hash[:name],
    description: hash[:description],
    children: hash[:children]&.map { |item| FeatureChild.from_h(item) },
  )
end
new( location: Location.new, tags: [], language: '', keyword: '', name: '', description: '', children: [] ) click to toggle source
# File lib/cucumber/messages.dtos.rb, line 508
def initialize(
  location: Location.new,
  tags: [],
  language: '',
  keyword: '',
  name: '',
  description: '',
  children: []
)
  @location = location
  @tags = tags
  @language = language
  @keyword = keyword
  @name = name
  @description = description
  @children = children
end