Class: Vx::ServiceConnector::Github::Payload

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paramsObject

Returns the value of attribute params

Returns:

  • (Object)

    the current value of params



6
7
8
# File 'lib/vx/service_connector/github/payload.rb', line 6

def params
  @params
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



6
7
8
# File 'lib/vx/service_connector/github/payload.rb', line 6

def session
  @session
end

Instance Method Details

#buildObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/vx/service_connector/github/payload.rb', line 8

def build
  ServiceConnector::Model::Payload.from_hash(
    internal_pull_request?: (pull_request? && !foreign_pull_request?),
    foreign_pull_request?:  foreign_pull_request?,
    pull_request_number:    pull_request_number,
    branch:                 branch,
    branch_label:           branch_label,
    sha:                    sha,
    message:                message,
    author:                 author,
    author_email:           author_email,
    web_url:                web_url,
    tag:                    tag_name,
    skip:                   ignore?,
  )
rescue ::Octokit::NotFound, ::Octokit::Unauthorized => e
  Rails.logger.warn "#{e.class}: #{e.message}" if defined?(Rails)
  OpenStruct.new ignore?: true
end