Class: Files::Release

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/release.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ Release

Returns a new instance of Release.



7
8
9
10
# File 'lib/files.com/models/release.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/release.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/release.rb', line 5

def options
  @options
end

Class Method Details

.get_latest(params = {}, options = {}) ⇒ Object

Parameters:

platform - string


34
35
36
37
38
39
# File 'lib/files.com/models/release.rb', line 34

def self.get_latest(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: platform must be an String") if params.dig(:platform) and !params.dig(:platform).is_a?(String)

  response, options = Api.send_request("/releases/latest", :get, params, options)
  Release.new(response.data, options)
end

Instance Method Details

#descriptionObject

string - Native release description



13
14
15
# File 'lib/files.com/models/release.rb', line 13

def description
  @attributes[:description]
end

#native_release_packagesObject

array - A list of native release packages



18
19
20
# File 'lib/files.com/models/release.rb', line 18

def native_release_packages
  @attributes[:native_release_packages]
end

#titleObject

string - Native release title



23
24
25
# File 'lib/files.com/models/release.rb', line 23

def title
  @attributes[:title]
end

#versionObject

string - Native release version



28
29
30
# File 'lib/files.com/models/release.rb', line 28

def version
  @attributes[:version]
end