Class: Googlets::Googlet
- Inherits:
-
Object
- Object
- Googlets::Googlet
- Defined in:
- lib/googlets/googlet.rb
Class Method Summary collapse
Class Method Details
.config_file ⇒ Object
19 20 21 |
# File 'lib/googlets/googlet.rb', line 19 def self.config_file Rails.root.join('config', 'google.yml') end |
.enabled? ⇒ Boolean
23 24 25 |
# File 'lib/googlets/googlet.rb', line 23 def self.enabled? true end |
.parse_config ⇒ Object
5 6 7 8 9 |
# File 'lib/googlets/googlet.rb', line 5 def self.parse_config read_config.each do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end end |
.read_config ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/googlets/googlet.rb', line 11 def self.read_config return {} unless File.exist?(config_file) config = YAML::load(ERB.new(IO.read(config_file)).result)[Rails.env] || {} config.symbolize_keys! config end |