Class: Cucumber::Messages::Meta

Inherits:
Message show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cucumber::Messages::Message::Utils

included

Methods included from Cucumber::Messages::Message::Serialization

#to_h, #to_json

Methods included from Cucumber::Messages::Message::Deserialization

included

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.



878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 878

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
end

Instance Attribute Details

#ciObject (readonly)

Returns the value of attribute ci.



876
877
878
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 876

def ci
  @ci
end

#cpuObject (readonly)

386, arm, amd64 etc



874
875
876
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 874

def cpu
  @cpu
end

#implementationObject (readonly)

SpecFlow, Cucumber-JVM, Cucumber.js, Cucumber-Ruby, Behat etc.



859
860
861
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 859

def implementation
  @implementation
end

#osObject (readonly)

Windows, Linux, MacOS etc



869
870
871
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 869

def os
  @os
end

#protocol_versionObject (readonly)

*

The [SEMVER](https://semver.org/) version number of the protocol


854
855
856
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 854

def protocol_version
  @protocol_version
end

#runtimeObject (readonly)

Java, Ruby, Node.js etc



864
865
866
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 864

def runtime
  @runtime
end

Class Method Details

.from_h(hash) ⇒ Object

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

Cucumber::Messages::Meta.from_h(some_hash) # => #<Cucumber::Messages::Meta:0x... ...>


479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 479

def self.from_h(hash)
  return nil if hash.nil?

  self.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