Class: Cucumber::Messages::Meta
- Defined in:
- lib/cucumber/messages/meta.rb
Overview
Represents the Meta message in Cucumber’s message protocol.
*
This message contains meta information about the environment. Consumers can use
this for various purposes.
Instance Attribute Summary collapse
-
#ci ⇒ Object
readonly
Returns the value of attribute ci.
-
#cpu ⇒ Object
readonly
386, arm, amd64 etc.
-
#implementation ⇒ Object
readonly
SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc.
-
#os ⇒ Object
readonly
Windows, Linux, MacOS etc.
-
#protocol_version ⇒ Object
readonly
-
The [SEMVER](semver.org/) version number of the protocol.
-
-
#runtime ⇒ Object
readonly
Java, Ruby, Node.js etc.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Meta from the given hash.
Instance Method Summary collapse
-
#initialize(protocol_version: '', implementation: Product.new, runtime: Product.new, os: Product.new, cpu: Product.new, ci: nil) ⇒ Meta
constructor
A new instance of Meta.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(protocol_version: '', implementation: Product.new, runtime: Product.new, os: Product.new, cpu: Product.new, ci: nil) ⇒ Meta
Returns a new instance of Meta.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cucumber/messages/meta.rb', line 43 def initialize( protocol_version: '', implementation: Product.new, runtime: Product.new, os: Product.new, cpu: Product.new, ci: nil ) @protocol_version = protocol_version @implementation = implementation @runtime = runtime @os = os @cpu = cpu @ci = ci super() end |
Instance Attribute Details
#ci ⇒ Object (readonly)
Returns the value of attribute ci.
41 42 43 |
# File 'lib/cucumber/messages/meta.rb', line 41 def ci @ci end |
#cpu ⇒ Object (readonly)
386, arm, amd64 etc
39 40 41 |
# File 'lib/cucumber/messages/meta.rb', line 39 def cpu @cpu end |
#implementation ⇒ Object (readonly)
SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc.
24 25 26 |
# File 'lib/cucumber/messages/meta.rb', line 24 def implementation @implementation end |
#os ⇒ Object (readonly)
Windows, Linux, MacOS etc
34 35 36 |
# File 'lib/cucumber/messages/meta.rb', line 34 def os @os end |
#protocol_version ⇒ Object (readonly)
*
The [SEMVER](https://semver.org/) version number of the protocol
19 20 21 |
# File 'lib/cucumber/messages/meta.rb', line 19 def protocol_version @protocol_version end |
#runtime ⇒ Object (readonly)
Java, Ruby, Node.js etc
29 30 31 |
# File 'lib/cucumber/messages/meta.rb', line 29 def runtime @runtime end |
Class Method Details
.from_h(hash) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/cucumber/messages/meta.rb', line 67 def self.from_h(hash) return nil if hash.nil? new( protocol_version: hash[:protocolVersion], implementation: Product.from_h(hash[:implementation]), runtime: Product.from_h(hash[:runtime]), os: Product.from_h(hash[:os]), cpu: Product.from_h(hash[:cpu]), ci: Ci.from_h(hash[:ci]) ) end |