Class: Drone::Commit
- Inherits:
-
Object
- Object
- Drone::Commit
- Defined in:
- lib/drone/commit.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#finished_at ⇒ Object
readonly
Returns the value of attribute finished_at.
-
#gravatar ⇒ Object
readonly
Returns the value of attribute gravatar.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#pull_request ⇒ Object
readonly
Returns the value of attribute pull_request.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id: nil, status: nil, sha: nil, started_at: nil, finished_at: nil, duration: nil, branch: nil, pull_request: nil, message: nil, author: nil, gravatar: nil, timestamp: nil, created_at: nil, updated_at: nil) ⇒ Commit
constructor
A new instance of Commit.
Constructor Details
#initialize(id: nil, status: nil, sha: nil, started_at: nil, finished_at: nil, duration: nil, branch: nil, pull_request: nil, message: nil, author: nil, gravatar: nil, timestamp: nil, created_at: nil, updated_at: nil) ⇒ Commit
Returns a new instance of Commit.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/drone/commit.rb', line 5 def initialize( id: nil, status: nil, sha: nil, started_at: nil, finished_at: nil, duration: nil, branch: nil, pull_request: nil, message: nil, author: nil, gravatar: nil, timestamp: nil, created_at: nil, updated_at: nil) @id = id @status = status @sha = sha @started_at = started_at @finished_at = finished_at @duration = duration @branch = branch @pull_request = pull_request @message = @author = @gravatar = gravatar @timestamp = @created_at = created_at @updated_at = updated_at end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def @author end |
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def branch @branch end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def created_at @created_at end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def duration @duration end |
#finished_at ⇒ Object (readonly)
Returns the value of attribute finished_at.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def finished_at @finished_at end |
#gravatar ⇒ Object (readonly)
Returns the value of attribute gravatar.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def gravatar @gravatar end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def id @id end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def @message end |
#pull_request ⇒ Object (readonly)
Returns the value of attribute pull_request.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def pull_request @pull_request end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def sha @sha end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def status @status end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def @timestamp end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/drone/commit.rb', line 3 def updated_at @updated_at end |
Class Method Details
.build_with_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/drone/commit.rb', line 27 def self.build_with_hash(hash) Commit.new( id: hash["id"], status: hash["status"], sha: hash["sha"], started_at: hash["started_at"], finished_at: hash["finished_at"], duration: hash["duration"], branch: hash["branch"], pull_request: hash["pull_request"], message: hash["message"], author: hash["author"], gravatar: hash["gravatar"], timestamp: Time.parse(hash["timestamp"]), created_at: hash["created_at"], updated_at: hash["updated_at"] ) end |