Class: Arstotzka::Options Private
- Inherits:
-
Sinclair::Options
- Object
- Sinclair::Options
- Arstotzka::Options
- Defined in:
- lib/arstotzka/options.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible to hold the options
Options is initialized when using ClassMethods#expose
Instance Method Summary collapse
-
#==(other) ⇒ TrueClass, FalseClass
private
Checks if another instance equals self.
-
#initialize(options_hash) ⇒ Arstotzka::Options
constructor
private
Creates a new instance of Options.
-
#keys ⇒ Array<String>
private
Retuns all keys used when fetching.
Constructor Details
#initialize(options_hash) ⇒ Arstotzka::Options
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new instance of Options
265 266 267 268 269 270 271 |
# File 'lib/arstotzka/options.rb', line 265 def initialize() klass = .delete(:class) warn ":class has been deprecated, prefer 'expose klass: #{klass}'" if klass [:klass] ||= klass super() end |
Instance Method Details
#==(other) ⇒ TrueClass, FalseClass
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks if another instance equals self
297 298 299 300 301 |
# File 'lib/arstotzka/options.rb', line 297 def ==(other) return false unless other.class == self.class to_h == other.to_h end |
#keys ⇒ Array<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Retuns all keys used when fetching
285 286 287 288 289 290 |
# File 'lib/arstotzka/options.rb', line 285 def keys return full_path.split('.') if full_path return [key.to_s] unless path&.present? [path, key].compact.join('.').split('.') end |