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/session.rb,
lib/garb/version.rb,
lib/garb/attributes.rb,
lib/garb/result_set.rb,
lib/garb/destination.rb,
lib/garb/request/data.rb,
lib/garb/path_attribute.rb,
lib/garb/core_ext/string.rb,
lib/garb/management/feed.rb,
lib/garb/management/goal.rb,
lib/garb/profile_reports.rb,
lib/garb/report_response.rb,
lib/garb/report_parameter.rb,
lib/garb/filter_parameters.rb,
lib/garb/management/account.rb,
lib/garb/management/profile.rb,
lib/garb/management/segment.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
-
.ca_cert_file ⇒ Object
writeonly
Sets the attribute ca_cert_file.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.open_timeout ⇒ Object
writeonly
Sets the attribute open_timeout.
-
.proxy_address ⇒ Object
Returns the value of attribute proxy_address.
-
.proxy_password ⇒ Object
Returns the value of attribute proxy_password.
-
.proxy_port ⇒ Object
Returns the value of attribute proxy_port.
-
.proxy_user ⇒ Object
Returns the value of attribute proxy_user.
-
.read_timeout ⇒ Object
writeonly
Sets the attribute read_timeout.
Instance Method Summary collapse
- #ca_cert_file ⇒ Object
- #from_google_analytics(thing) ⇒ Object (also: #from_ga)
- #log(str, level = :debug) ⇒ Object
- #open_timeout ⇒ Object
- #read_timeout ⇒ Object
- #to_google_analytics(thing) ⇒ Object (also: #to_ga)
- #use_fibers ⇒ Object
- #use_fibers=(val) ⇒ Object
Class Attribute Details
.ca_cert_file=(value) ⇒ Object (writeonly)
Sets the attribute ca_cert_file
46 47 48 |
# File 'lib/garb.rb', line 46 def ca_cert_file=(value) @ca_cert_file = value end |
.logger ⇒ Object
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
46 47 48 |
# File 'lib/garb.rb', line 46 def open_timeout=(value) @open_timeout = value end |
.proxy_address ⇒ Object
Returns the value of attribute proxy_address.
45 46 47 |
# File 'lib/garb.rb', line 45 def proxy_address @proxy_address end |
.proxy_password ⇒ Object
Returns the value of attribute proxy_password.
45 46 47 |
# File 'lib/garb.rb', line 45 def proxy_password @proxy_password end |
.proxy_port ⇒ Object
Returns the value of attribute proxy_port.
45 46 47 |
# File 'lib/garb.rb', line 45 def proxy_port @proxy_port end |
.proxy_user ⇒ Object
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
46 47 48 |
# File 'lib/garb.rb', line 46 def read_timeout=(value) @read_timeout = value end |
Instance Method Details
#ca_cert_file ⇒ Object
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_timeout ⇒ Object
61 62 63 |
# File 'lib/garb.rb', line 61 def open_timeout @open_timeout || 60 end |
#read_timeout ⇒ Object
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_fibers ⇒ Object
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 |