Module: Garb

Extended by:
Garb
Included in:
Garb
Defined in:
lib/garb.rb,
lib/garb.rb,
lib/garb/step.rb,
lib/garb/model.rb,
lib/garb/errors.rb,
lib/garb/version.rb,
lib/garb/session.rb,
lib/garb/result_set.rb,
lib/garb/attributes.rb,
lib/garb/destination.rb,
lib/garb/request/data.rb,
lib/garb/path_attribute.rb,
lib/garb/profile_reports.rb,
lib/garb/management/goal.rb,
lib/garb/core_ext/string.rb,
lib/garb/report_response.rb,
lib/garb/management/feed.rb,
lib/garb/report_parameter.rb,
lib/garb/filter_parameters.rb,
lib/garb/management/segment.rb,
lib/garb/management/account.rb,
lib/garb/management/profile.rb,
lib/garb/request/authentication.rb,
lib/garb/management/web_property.rb

Defined Under Namespace

Modules: Attributes, Inflector, Management, Model, PathAttribute, ProfileReports, Request, VERSION Classes: AuthError, BackendError, BadRequestError, ClientError, Destination, Error, FilterParameters, InsufficientPermissionsError, InvalidCredentialsError, MissingCertFileError, ReportParameter, ReportResponse, ResultSet, Session, Step

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.ca_cert_file=(value) ⇒ Object (writeonly)

Sets the attribute ca_cert_file

Parameters:

  • value

    the value to set the attribute ca_cert_file to.


46
47
48
# File 'lib/garb.rb', line 46

def ca_cert_file=(value)
  @ca_cert_file = value
end

.loggerObject

Returns the value of attribute logger


45
46
47
# File 'lib/garb.rb', line 45

def logger
  @logger
end

.open_timeout=(value) ⇒ Object (writeonly)

Sets the attribute open_timeout

Parameters:

  • value

    the value to set the attribute open_timeout to.


46
47
48
# File 'lib/garb.rb', line 46

def open_timeout=(value)
  @open_timeout = value
end

.proxy_addressObject

Returns the value of attribute proxy_address


45
46
47
# File 'lib/garb.rb', line 45

def proxy_address
  @proxy_address
end

.proxy_passwordObject

Returns the value of attribute proxy_password


45
46
47
# File 'lib/garb.rb', line 45

def proxy_password
  @proxy_password
end

.proxy_portObject

Returns the value of attribute proxy_port


45
46
47
# File 'lib/garb.rb', line 45

def proxy_port
  @proxy_port
end

.proxy_userObject

Returns the value of attribute proxy_user


45
46
47
# File 'lib/garb.rb', line 45

def proxy_user
  @proxy_user
end

.read_timeout=(value) ⇒ Object (writeonly)

Sets the attribute read_timeout

Parameters:

  • value

    the value to set the attribute read_timeout to.


46
47
48
# File 'lib/garb.rb', line 46

def read_timeout=(value)
  @read_timeout = value
end

Instance Method Details

#ca_cert_fileObject


69
70
71
# File 'lib/garb.rb', line 69

def ca_cert_file
  @ca_cert_file || raise(MissingCertFileError)
end

#from_google_analytics(thing) ⇒ Object Also known as: from_ga


85
86
87
# File 'lib/garb.rb', line 85

def from_google_analytics(thing)
  thing.to_s.gsub(/^ga\:/, '').underscore
end

#log(str, level = :debug) ⇒ Object


73
74
75
76
# File 'lib/garb.rb', line 73

def log(str, level = :debug)
  level, str = str, level if str.is_a? Symbol
  logger.send level, str unless logger.nil?
end

#open_timeoutObject


61
62
63
# File 'lib/garb.rb', line 61

def open_timeout
  @open_timeout || 60
end

#read_timeoutObject


65
66
67
# File 'lib/garb.rb', line 65

def read_timeout
  @read_timeout || 60
end

#to_google_analytics(thing) ⇒ Object Also known as: to_ga


78
79
80
81
82
# File 'lib/garb.rb', line 78

def to_google_analytics(thing)
  return thing.to_google_analytics if thing.respond_to? :to_google_analytics

  "#{$1}ga:#{$2}" if "#{thing.to_s.camelize(:lower)}" =~ /^(-)?(.*)$/
end

#use_fibersObject


57
58
59
# File 'lib/garb.rb', line 57

def use_fibers
  @use_fibers || false
end

#use_fibers=(val) ⇒ Object


49
50
51
52
53
54
55
# File 'lib/garb.rb', line 49

def use_fibers=(val)
  if val and (!defined?(EM) || !defined?(Fiber))
    raise ArgumentError, 'Eventmachine and Fibers required (Ruby 1.9+ only)'
  end
  require 'em-net-http' if val
  @use_fibers = val
end