Class: Files::Setting
- Inherits:
-
Object
- Object
- Files::Setting
- Defined in:
- lib/files.com/models/setting.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .all(params = {}, options = {}) ⇒ Object
-
.get_domain(params = {}, options = {}) ⇒ Object
Parameters: domain (required) - string.
- .languages(params = {}, options = {}) ⇒ Object
- .list(params = {}, options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes = {}, options = {}) ⇒ Setting
constructor
A new instance of Setting.
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/setting.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/setting.rb', line 5 def @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 = {}, = {}) list(params, ) 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 = {}, = {}) 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, = Api.send_request("/settings/domain", :get, params, ) Settings.new(response.data, ) end |
.languages(params = {}, options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/files.com/models/setting.rb', line 12 def self.languages(params = {}, = {}) response, = Api.send_request("/settings/languages", :get, params, ) response.data end |
.list(params = {}, options = {}) ⇒ Object
17 18 19 20 |
# File 'lib/files.com/models/setting.rb', line 17 def self.list(params = {}, = {}) response, = Api.send_request("/settings", :get, params, ) Settings.new(response.data, ) end |