Class: Cucumber::Messages::Examples
- Defined in:
- lib/cucumber/messages/examples.rb
Overview
Represents the Examples message in Cucumber’s message protocol.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#location ⇒ Object
readonly
The location of the ‘Examples` keyword.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table_body ⇒ Object
readonly
Returns the value of attribute table_body.
-
#table_header ⇒ Object
readonly
Returns the value of attribute table_header.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Examples from the given hash.
Instance Method Summary collapse
-
#initialize(location: Location.new, tags: [], keyword: '', name: '', description: '', table_header: nil, table_body: [], id: '') ⇒ Examples
constructor
A new instance of Examples.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(location: Location.new, tags: [], keyword: '', name: '', description: '', table_header: nil, table_body: [], id: '') ⇒ Examples
Returns a new instance of Examples.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/cucumber/messages/examples.rb', line 30 def initialize( location: Location.new, tags: [], keyword: '', name: '', description: '', table_header: nil, table_body: [], id: '' ) @location = location @tags = @keyword = keyword @name = name @description = description @table_header = table_header @table_body = table_body @id = id super() end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
22 23 24 |
# File 'lib/cucumber/messages/examples.rb', line 22 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
28 29 30 |
# File 'lib/cucumber/messages/examples.rb', line 28 def id @id end |
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
18 19 20 |
# File 'lib/cucumber/messages/examples.rb', line 18 def keyword @keyword end |
#location ⇒ Object (readonly)
The location of the ‘Examples` keyword
14 15 16 |
# File 'lib/cucumber/messages/examples.rb', line 14 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
20 21 22 |
# File 'lib/cucumber/messages/examples.rb', line 20 def name @name end |
#table_body ⇒ Object (readonly)
Returns the value of attribute table_body.
26 27 28 |
# File 'lib/cucumber/messages/examples.rb', line 26 def table_body @table_body end |
#table_header ⇒ Object (readonly)
Returns the value of attribute table_header.
24 25 26 |
# File 'lib/cucumber/messages/examples.rb', line 24 def table_header @table_header end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
16 17 18 |
# File 'lib/cucumber/messages/examples.rb', line 16 def @tags end |
Class Method Details
.from_h(hash) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cucumber/messages/examples.rb', line 58 def self.from_h(hash) return nil if hash.nil? 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 |