Class: Dawn::Release

Inherits:
Object
  • Object
show all
Includes:
BaseApi
Defined in:
lib/dawn/api/models/release.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from BaseApi

included, #to_h

Methods included from BaseApi::RequestExtension

#request

Methods included from SafeExtension

#safe

Constructor Details

#initialize(data) ⇒ Release

Returns a new instance of Release.

Parameters:

  • data (Hash)


23
24
25
26
# File 'lib/dawn/api/models/release.rb', line 23

def initialize(data)
  @app = nil
  @data = data
end

Instance Attribute Details

#appDawn::App

Returns:



31
32
33
# File 'lib/dawn/api/models/release.rb', line 31

def app
  @app ||= App.find(id: app_id)
end

Class Method Details

.all(options = {}) ⇒ Array<Dawn::Release>

Parameters:

  • options (Hash) (defaults to: {})

Returns:



50
51
52
53
54
55
# File 'lib/dawn/api/models/release.rb', line 50

def self.all(options={})
  get(
    path: "/releases",
    query: options
  ).map { |hsh| new hsh["release"] }
end

.find(options = {}) ⇒ Dawn::Release

Parameters:

  • options (Hash) (defaults to: {})

Returns:



61
62
63
64
65
66
67
68
# File 'lib/dawn/api/models/release.rb', line 61

def self.find(options={})
  id = id_param(options)

  new get(
    path: "/releases/#{id}",
    query: options
  )["release"]
end

Instance Method Details

#refreshself

Returns:

  • (self)


38
39
40
41
42
43
44
# File 'lib/dawn/api/models/release.rb', line 38

def refresh
  @data = get(
    path: "/releases/#{id}",
    query: options
  )["release"]
  self
end