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.



8
9
10
11
12
13
# File 'lib/flowdock/git/builder.rb', line 8

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



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

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