Class: GoogleApi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/google_api/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Configuration

Returns a new instance of Configuration.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/google_api/configuration.rb', line 4

def initialize(config = {})
  config.each do |key, value|
    eval "      def \#{key}=(value)\n        @\#{key} = value\n      end\n\n      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    METHOD\n\n    self.send(\"\#{key}=\", value)\n  end\nend\n"

Instance Method Details

#configure(&block) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/google_api/configuration.rb', line 28

def configure(&block)
  if block_given?
    yield self
  end

  self
end