Class: Flowdock::Git::Commit

Inherits:
Object
  • Object
show all
Defined in:
lib/flowdock/git/builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(external_thread_id, thread, tags, commit) ⇒ Commit

Returns a new instance of Commit.


5
6
7
8
9
10
# File 'lib/flowdock/git/builder.rb', line 5

def initialize(external_thread_id, thread, tags, commit)
  @commit = commit
  @external_thread_id = external_thread_id
  @thread = thread
  @tags = tags
end

Instance Method Details

#to_hashObject


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/flowdock/git/builder.rb', line 12

def to_hash
  hash = {
    external_thread_id: @external_thread_id,
    event: "activity",
    author: {
      name: @commit[:author][:name],
      email: @commit[:author][:email]
    },
    title: title,
    thread: @thread,
    body: body
  }
  hash[:tags] = @tags if @tags
  encode(hash)
end