Class: WotApiRu::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/wot_api_ru/settings.rb

Overview

Storage for application settings

Author:

  • Ivan Bondarenko

Class Method Summary collapse

Class Method Details

.[](ind) ⇒ String

Note:

This method may get parameter which user set in initializer wot_api_ru

Get settings

Parameters:

  • ind (String, Symbol)

    the key of setting value

Returns:

  • (String)

    value settings



12
13
14
# File 'lib/wot_api_ru/settings.rb', line 12

def [](ind)
  @options[ind.to_sym]
end

.[]=(ind, val) ⇒ Object

Note:

This method may set or modify application settings

Set settings

Parameters:

  • ind (String, Symbol)

    the key of setting value

  • val

    the value of setting value

Returns:

  • val



21
22
23
# File 'lib/wot_api_ru/settings.rb', line 21

def []=(ind, val)
  @options[ind.to_sym] = val.to_s
end