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.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cucumber/messages/meta.rb', line 41 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.
39 40 41 |
# File 'lib/cucumber/messages/meta.rb', line 39 def ci @ci end |
#cpu ⇒ Object (readonly)
386, arm, amd64 etc
37 38 39 |
# File 'lib/cucumber/messages/meta.rb', line 37 def cpu @cpu end |
#implementation ⇒ Object (readonly)
SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc.
22 23 24 |
# File 'lib/cucumber/messages/meta.rb', line 22 def implementation @implementation end |
#os ⇒ Object (readonly)
Windows, Linux, MacOS etc
32 33 34 |
# File 'lib/cucumber/messages/meta.rb', line 32 def os @os end |
#protocol_version ⇒ Object (readonly)
The [SEMVER](semver.org/) version number of the protocol
17 18 19 |
# File 'lib/cucumber/messages/meta.rb', line 17 def protocol_version @protocol_version end |
#runtime ⇒ Object (readonly)
Java, Ruby, Node.js etc
27 28 29 |
# File 'lib/cucumber/messages/meta.rb', line 27 def runtime @runtime end |
Class Method Details
.from_h(hash) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cucumber/messages/meta.rb', line 65 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 |