Class: Cucumber::Messages::Ci

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 Ci message in Cucumber’s message protocol.

CI environment

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Message::Utils

included

Methods included from Message::Serialization

#to_h, #to_json

Methods included from Message::Deserialization

included

Constructor Details

#initialize(name: '', url: nil, build_number: nil, git: nil) ⇒ Ci

Returns a new instance of Ci.



921
922
923
924
925
926
927
928
929
930
931
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 921

def initialize(
  name: '',
  url: nil,
  build_number: nil,
  git: nil
)
  @name = name
  @url = url
  @build_number = build_number
  @git = git
end

Instance Attribute Details

#build_numberObject (readonly)

The build number. Some CI servers use non-numeric build numbers, which is why this is a string



917
918
919
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 917

def build_number
  @build_number
end

#gitObject (readonly)

Returns the value of attribute git.



919
920
921
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 919

def git
  @git
end

#nameObject (readonly)

Name of the CI product, e.g. “Jenkins”, “CircleCI” etc.



907
908
909
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 907

def name
  @name
end

#urlObject (readonly)

Link to the build



912
913
914
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 912

def url
  @url
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


503
504
505
506
507
508
509
510
511
512
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 503

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

  self.new(
    name: hash[:name],
    url: hash[:url],
    build_number: hash[:buildNumber],
    git: Git.from_h(hash[:git]),
  )
end