Class: Pronto::Formatter::GithubStatusFormatter::StatusBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/pronto/formatter/github_status_formatter/status_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(runner, messages) ⇒ StatusBuilder

Returns a new instance of StatusBuilder.



7
8
9
10
# File 'lib/pronto/formatter/github_status_formatter/status_builder.rb', line 7

def initialize(runner, messages)
  @runner = runner
  @messages = messages
end

Instance Method Details

#contextObject



21
22
23
# File 'lib/pronto/formatter/github_status_formatter/status_builder.rb', line 21

def context
  "pronto/#{@runner.title}"
end

#descriptionObject



12
13
14
15
# File 'lib/pronto/formatter/github_status_formatter/status_builder.rb', line 12

def description
  desc = map_description
  desc.empty? ? NO_ISSUES_DESCRIPTION : "Found #{desc}."
end

#stateObject



17
18
19
# File 'lib/pronto/formatter/github_status_formatter/status_builder.rb', line 17

def state
  failure? ? :failure : :success
end