Module: GaExampleGem

Defined in:
lib/ga_example_gem.rb,
lib/ga_example_gem/client.rb,
lib/ga_example_gem/version.rb,
lib/ga_example_gem/configuration.rb

Overview

This is our GaExampleGem namespace for our gem

Defined Under Namespace

Modules: Configuration Classes: Client

Constant Summary collapse

VERSION =

This sets the version of our gem Its a bit complex, but check out Semantic Versionining semver.org/

"0.0.1"

Class Method Summary collapse

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

Delegate to GaExampleGem::Client This is a weird trick that allows for calling on methods without calling .new first



16
17
18
19
# File 'lib/ga_example_gem.rb', line 16

def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end

.newObject

Alias for GaExampleGem::Client.new



9
10
11
# File 'lib/ga_example_gem.rb', line 9

def new
  @client ||= GaExampleGem::Client.new
end

.respond_to?(method, include_private = false) ⇒ Boolean

This is used for the method_missing to see if a new client would respond to a method

Returns:

  • (Boolean)


24
25
26
# File 'lib/ga_example_gem.rb', line 24

def respond_to?(method, include_private=false)
  new.respond_to?(method, include_private) || super(method, include_private)
end