Class: Cucumber::Messages::Git

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

Information about Git, provided by the Build/CI server as environment

variables.

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(remote: '', revision: '', branch: nil, tag: nil) ⇒ Git

Returns a new instance of Git.



952
953
954
955
956
957
958
959
960
961
962
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 952

def initialize(
  remote: '',
  revision: '',
  branch: nil,
  tag: nil
)
  @remote = remote
  @revision = revision
  @branch = branch
  @tag = tag
end

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



948
949
950
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 948

def branch
  @branch
end

#remoteObject (readonly)

Returns the value of attribute remote.



944
945
946
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 944

def remote
  @remote
end

#revisionObject (readonly)

Returns the value of attribute revision.



946
947
948
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 946

def revision
  @revision
end

#tagObject (readonly)

Returns the value of attribute tag.



950
951
952
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.dtos.rb', line 950

def tag
  @tag
end

Class Method Details

.from_h(hash) ⇒ Object

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

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


525
526
527
528
529
530
531
532
533
534
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-messages-18.0.0/lib/cucumber/messages.deserializers.rb', line 525

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

  self.new(
    remote: hash[:remote],
    revision: hash[:revision],
    branch: hash[:branch],
    tag: hash[:tag],
  )
end