module Yotpo

Constants

VERSION

Attributes

app_key[RW]

@!attribute app_key @return [String] the app key that is registered with Yotpo

parallel_requests[RW]

@!attribute parallel_requests @return [Integer String] defines the maximum parallel request for the gem to preform

secret[RW]

@!attribute secret @return [String] the secret that is registered with Yotpo

timeout[RW]

@!attribute timeout @return [int] connection timeout in seconds

url[RW]

@!attribute url @return [String] the base url of the Yotpo Api

user_agent[RW]

@!attribute user_agent @return [string] global user agent in header

Public Class Methods

client() click to toggle source

@return an instance of Yotpo::Client

# File lib/yotpo.rb, line 50
def client
  @client ||= Yotpo::Client.new(@url || 'https://api.yotpo.com', @parallel_requests || 5, @timeout || 60, @user_agent)
end
configure() { |self| ... } click to toggle source

Configuration interface of the gem

@yield [self] to accept configuration settings

# File lib/yotpo.rb, line 33
def configure
  yield self
  true
end
respond_to_missing?(method_name, include_private=false) click to toggle source

Makes sure that the method missing is checked with the Yotpo::Client instance

@param method_name [String] the name of the method we want to run @param include_private [Boolean] defines wether to check for private functions as well

# File lib/yotpo.rb, line 43
def respond_to_missing?(method_name, include_private=false)
  client.respond_to?(method_name, include_private)
end

Private Class Methods

method_missing(method_name, *args, &block) click to toggle source

executes any function on the Yotpo::Client instance

@param args [*] any argument that we want to pass to the client function @param block [Block] any block that is passed to the client function

Calls superclass method
# File lib/yotpo.rb, line 61
def method_missing(method_name, *args, &block)
  return super unless client.respond_to?(method_name)
  client.send(method_name, *args, &block)
end