Class: SimpleGoogleCustomSearch::SgcsConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_google_custom_search/sgcs_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSgcsConfig

Returns a new instance of SgcsConfig.



4
5
6
7
8
9
10
# File 'lib/simple_google_custom_search/sgcs_config.rb', line 4

def initialize
  raise 'Please set constant variable SGCS_CONFIG' unless defined?(SGCS_CONFIG)
  config = SGCS_CONFIG.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
  raise 'Please set constant variable SGCS_CONFIG[:domain]' if config[:domain].nil?
  
  @domain = config[:domain]
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



2
3
4
# File 'lib/simple_google_custom_search/sgcs_config.rb', line 2

def domain
  @domain
end

Instance Method Details

#get_configObject



12
13
14
15
16
# File 'lib/simple_google_custom_search/sgcs_config.rb', line 12

def get_config
  @config ||= {
    domain: @domain
  }
end