Class: Drone::BuildRepresenter

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::JSON
Defined in:
lib/drone/models/build_representer.rb

Overview

Transform ‘build` JSON payload

Instance Attribute Summary collapse

Instance Attribute Details

#authorString

Returns the commit author.

Returns:

  • (String)

    the commit author



81
# File 'lib/drone/models/build_representer.rb', line 81

property :author

#author_avatarString

Returns the link to author avatar.

Returns:

  • (String)

    the link to author avatar



85
# File 'lib/drone/models/build_representer.rb', line 85

property :author_avatar

#author_emailString

Returns the email of the author.

Returns:

  • (String)

    the email of the author



89
# File 'lib/drone/models/build_representer.rb', line 89

property :author_email

#branchString

Returns the branch of the build.

Returns:

  • (String)

    the branch of the build



52
# File 'lib/drone/models/build_representer.rb', line 52

property :branch

#commitString

Returns the commit hash of the build.

Returns:

  • (String)

    the commit hash of the build



48
# File 'lib/drone/models/build_representer.rb', line 48

property :commit

#created_atTime

Returns the time when the build have been created.

Returns:

  • (Time)

    the time when the build have been created



111
112
113
114
115
116
# File 'lib/drone/models/build_representer.rb', line 111

property :created_at,
setter: lambda { |options| # rubocop:disable Style/BlockDelimiters
  options[:represented].created_at = Time.at(
    options[:fragment]
  ).utc
}

#deploy_toString

Returns the target of the deploy.

Returns:

  • (String)

    the target of the deploy



44
# File 'lib/drone/models/build_representer.rb', line 44

property :deploy_to

#enqueued_atTime

Returns the time when the build have been enqueued.

Returns:

  • (Time)

    the time when the build have been enqueued



102
103
104
105
106
107
# File 'lib/drone/models/build_representer.rb', line 102

property :enqueued_at,
setter: lambda { |options| # rubocop:disable Style/BlockDelimiters
  options[:represented].enqueued_at = Time.at(
    options[:fragment]
  ).utc
}

#eventString

Returns the event of the build.

Returns:

  • (String)

    the event of the build



36
# File 'lib/drone/models/build_representer.rb', line 36

property :event

#finished_atTime

Returns the time when the build have been finished.

Returns:

  • (Time)

    the time when the build have been finished



129
130
131
132
133
134
# File 'lib/drone/models/build_representer.rb', line 129

property :finished_at,
setter: lambda { |options| # rubocop:disable Style/BlockDelimiters
  options[:represented].finished_at = Time.at(
    options[:fragment]
  ).utc
}

#idInteger

Returns the ID of the build.

Returns:

  • (Integer)

    the ID of the build



28
# File 'lib/drone/models/build_representer.rb', line 28

property :id

Returns the link to the current build.

Returns:

  • (String)

    the link to the current build



76
77
# File 'lib/drone/models/build_representer.rb', line 76

property :link,
as: :link_url

#messageString

Returns the commit message of the build.

Returns:

  • (String)

    the commit message of the build



72
# File 'lib/drone/models/build_representer.rb', line 72

property :message

#numberInteger

Returns the number of the build.

Returns:

  • (Integer)

    the number of the build



32
# File 'lib/drone/models/build_representer.rb', line 32

property :number

#refString

Returns the reference of the build.

Returns:

  • (String)

    the reference of the build



56
# File 'lib/drone/models/build_representer.rb', line 56

property :ref

#refspecString

Returns the reference spec of the build.

Returns:

  • (String)

    the reference spec of the build



60
# File 'lib/drone/models/build_representer.rb', line 60

property :refspec

#remoteString

Returns the remote name of the build.

Returns:

  • (String)

    the remote name of the build



64
# File 'lib/drone/models/build_representer.rb', line 64

property :remote

#started_atTime

Returns the time when the build have been started.

Returns:

  • (Time)

    the time when the build have been started



120
121
122
123
124
125
# File 'lib/drone/models/build_representer.rb', line 120

property :started_at,
setter: lambda { |options| # rubocop:disable Style/BlockDelimiters
  options[:represented].started_at = Time.at(
    options[:fragment]
  ).utc
}

#statusString

Returns the status of the build.

Returns:

  • (String)

    the status of the build



40
# File 'lib/drone/models/build_representer.rb', line 40

property :status

#timestampTime

Returns the timestamp of the build.

Returns:

  • (Time)

    the timestamp of the build



93
94
95
96
97
98
# File 'lib/drone/models/build_representer.rb', line 93

property :timestamp,
setter: lambda { |options| # rubocop:disable Style/BlockDelimiters
  options[:represented].timestamp = Time.at(
    options[:fragment]
  ).utc
}

#titleString

Returns the title of the build.

Returns:

  • (String)

    the title of the build



68
# File 'lib/drone/models/build_representer.rb', line 68

property :title