Class: Cucumber::Messages::Product
- Defined in:
- lib/cucumber/messages/product.rb
Overview
Represents the Product message in Cucumber’s message protocol.
Used to describe various properties of Meta
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
The product name.
-
#version ⇒ Object
readonly
The product version.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Product from the given hash.
Instance Method Summary collapse
-
#initialize(name: '', version: nil) ⇒ Product
constructor
A new instance of Product.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(name: '', version: nil) ⇒ Product
Returns a new instance of Product.
23 24 25 26 27 28 29 30 |
# File 'lib/cucumber/messages/product.rb', line 23 def initialize( name: '', version: nil ) @name = name @version = version super() end |
Instance Attribute Details
#name ⇒ Object (readonly)
The product name
16 17 18 |
# File 'lib/cucumber/messages/product.rb', line 16 def name @name end |
#version ⇒ Object (readonly)
The product version
21 22 23 |
# File 'lib/cucumber/messages/product.rb', line 21 def version @version end |
Class Method Details
.from_h(hash) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/cucumber/messages/product.rb', line 39 def self.from_h(hash) return nil if hash.nil? new( name: hash[:name], version: hash[:version] ) end |