Class: Vx::ServiceConnector::Model::Payload

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorObject

Returns the value of attribute author

Returns:

  • (Object)

    the current value of author



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def author
  @author
end

#author_emailObject

Returns the value of attribute author_email

Returns:

  • (Object)

    the current value of author_email



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def author_email
  @author_email
end

#branchObject

Returns the value of attribute branch

Returns:

  • (Object)

    the current value of branch



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def branch
  @branch
end

#branch_labelObject

Returns the value of attribute branch_label

Returns:

  • (Object)

    the current value of branch_label



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def branch_label
  @branch_label
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def message
  @message
end

#pull_request?Object

Returns the value of attribute pull_request?

Returns:

  • (Object)

    the current value of pull_request?



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def pull_request?
  @pull_request?
end

#pull_request_numberObject

Returns the value of attribute pull_request_number

Returns:

  • (Object)

    the current value of pull_request_number



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def pull_request_number
  @pull_request_number
end

#shaObject

Returns the value of attribute sha

Returns:

  • (Object)

    the current value of sha



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def sha
  @sha
end

#skipObject

Returns the value of attribute skip

Returns:

  • (Object)

    the current value of skip



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def skip
  @skip
end

#web_urlObject

Returns the value of attribute web_url

Returns:

  • (Object)

    the current value of web_url



16
17
18
# File 'lib/vx/service_connector/model.rb', line 16

def web_url
  @web_url
end

Class Method Details

.from_hash(params) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/vx/service_connector/model.rb', line 35

def from_hash(params)
  payload = Payload.new
  payload.members.each do |m|
    payload[m] = params.key?(m) ? params[m] : params[m.to_s]
  end
  payload
end

Instance Method Details

#ignore?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/vx/service_connector/model.rb', line 30

def ignore?
  skip || message.to_s =~ /#{PAYLOAD_IGNORE_RE}/
end

#to_hashObject



28
# File 'lib/vx/service_connector/model.rb', line 28

def to_hash ; to_h end