module GaExampleGem
This is our GaExampleGem
namespace for our gem
Constants
- VERSION
This sets the version of our gem Its a bit complex, but check out Semantic Versionining semver.org/
Public Class Methods
method_missing(method, *args, &block)
click to toggle source
Delegate to GaExampleGem::Client
This is a weird trick that allows for calling on methods without calling .new first
Calls superclass method
# File lib/ga_example_gem.rb, line 20 def method_missing(method, *args, &block) # Normally this raises an error return super unless new.respond_to?(method) new.send(method, *args, &block) end
new()
click to toggle source
Alias for GaExampleGem::Client.new
# File lib/ga_example_gem.rb, line 13 def new @client ||= GaExampleGem::Client.new end
respond_to?(method, include_private=false)
click to toggle source
This is used for the method_missing
to see if a new client would respond to a method
Calls superclass method
# File lib/ga_example_gem.rb, line 29 def respond_to?(method, include_private=false) new.respond_to?(method, include_private) || super(method, include_private) end