Class: Cucumber::Messages::Git
- Defined in:
- lib/cucumber/messages/git.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
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#remote ⇒ Object
readonly
Returns the value of attribute remote.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
-
#tag ⇒ Object
readonly
Returns the value of attribute tag.
Class Method Summary collapse
-
.from_h(hash) ⇒ Object
Returns a new Git from the given hash.
Instance Method Summary collapse
-
#initialize(remote: '', revision: '', branch: nil, tag: nil) ⇒ Git
constructor
A new instance of Git.
Methods inherited from Message
camelize, from_json, #to_h, #to_json
Constructor Details
#initialize(remote: '', revision: '', branch: nil, tag: nil) ⇒ Git
Returns a new instance of Git.
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cucumber/messages/git.rb', line 22 def initialize( remote: '', revision: '', branch: nil, tag: nil ) @remote = remote @revision = revision @branch = branch @tag = tag super() end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
18 19 20 |
# File 'lib/cucumber/messages/git.rb', line 18 def branch @branch end |
#remote ⇒ Object (readonly)
Returns the value of attribute remote.
14 15 16 |
# File 'lib/cucumber/messages/git.rb', line 14 def remote @remote end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
16 17 18 |
# File 'lib/cucumber/messages/git.rb', line 16 def revision @revision end |
#tag ⇒ Object (readonly)
Returns the value of attribute tag.
20 21 22 |
# File 'lib/cucumber/messages/git.rb', line 20 def tag @tag end |
Class Method Details
.from_h(hash) ⇒ Object
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/cucumber/messages/git.rb', line 42 def self.from_h(hash) return nil if hash.nil? new( remote: hash[:remote], revision: hash[:revision], branch: hash[:branch], tag: hash[:tag] ) end |