Class: GoogleApi::Configuration
- Inherits:
-
Object
- Object
- GoogleApi::Configuration
- Defined in:
- lib/google_api/configuration.rb
Constant Summary collapse
- DEFAULT =
{ client_id: nil, client_secret: nil, client_developer_email: nil, client_cert_file: nil, key_secret: 'notasecret', redirect_uri: nil, }
Instance Method Summary collapse
- #configure(&block) ⇒ Object
-
#initialize(config, use_default = true) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config, use_default = true) ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/google_api/configuration.rb', line 13 def initialize(config, use_default = true) if use_default config = DEFAULT.merge(config) end config.each do |key, value| eval " def \#{key}(value = nil, &block)\n if block_given?\n @\#{key}.instance_eval(&block)\n end\n\n if value.nil?\n return @\#{key}\n end\n\n self.\#{key} = value\n end\n\n def \#{key}=(value)\n @\#{key} = value\n end\n METHOD\n\n self.send(\"\#{key}=\", value)\n end\nend\n" |
Instance Method Details
#configure(&block) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/google_api/configuration.rb', line 42 def configure(&block) if block_given? yield self end self end |