Class: Vx::ServiceConnector::Github::Notices

Inherits:
Struct
  • Object
show all
Defined in:
lib/vx/service_connector/github/notices.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#repoObject

Returns the value of attribute repo

Returns:

  • (Object)

    the current value of repo



4
5
6
# File 'lib/vx/service_connector/github/notices.rb', line 4

def repo
  @repo
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



4
5
6
# File 'lib/vx/service_connector/github/notices.rb', line 4

def session
  @session
end

Instance Method Details

#create(build_sha, build_status, build_url, description) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/vx/service_connector/github/notices.rb', line 6

def create(build_sha, build_status, build_url, description)
  if status = github_status(build_status)
    begin
      session.create_status(
        repo.full_name,
        build_sha,
        status,
        description: description,
        target_url:  build_url
      )
    rescue Octokit::UnprocessableEntity, Octokit::Unauthorized
    end
  end
end