Class: Files::Setting

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Setting.



7
8
9
10
# File 'lib/files.com/models/setting.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/setting.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

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



22
23
24
# File 'lib/files.com/models/setting.rb', line 22

def self.all(params = {}, options = {})
  list(params, options)
end

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

Parameters:

domain (required) - string


28
29
30
31
32
33
34
# File 'lib/files.com/models/setting.rb', line 28

def self.get_domain(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: domain must be an String") if params.dig(:domain) and !params.dig(:domain).is_a?(String)
  raise MissingParameterError.new("Parameter missing: domain") unless params.dig(:domain)

  response, options = Api.send_request("/settings/domain", :get, params, options)
  Settings.new(response.data, options)
end

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



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

def self.languages(params = {}, options = {})
  response, _options = Api.send_request("/settings/languages", :get, params, options)
  response.data
end

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



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

def self.list(params = {}, options = {})
  response, options = Api.send_request("/settings", :get, params, options)
  Settings.new(response.data, options)
end