Module: Turbovax

Defined in:
lib/turbovax.rb,
lib/turbovax/portal.rb,
lib/turbovax/version.rb,
lib/turbovax/location.rb,
lib/turbovax/constants.rb,
lib/turbovax/appointment.rb,
lib/turbovax/data_fetcher.rb,
lib/turbovax/twitter_client.rb,
lib/turbovax/handlers/location_handler.rb

Overview

Turbovax gem

Defined Under Namespace

Modules: Constants, Handlers Classes: Appointment, DataFetcher, InvalidRequestTypeError, Location, Portal, TwitterClient

Constant Summary collapse

VERSION =
"0.0.4"

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Turbovax)

    the object that the method was called on



19
20
21
# File 'lib/turbovax.rb', line 19

def self.configure
  yield self
end

.faraday_logging_configObject



56
57
58
# File 'lib/turbovax.rb', line 56

def self.faraday_logging_config
  @faraday_logging_config ||= { headers: false, bodies: false, log_level: :info }
end

.faraday_logging_config=(faraday_logging_config) ⇒ Object



60
61
62
# File 'lib/turbovax.rb', line 60

def self.faraday_logging_config=(faraday_logging_config)
  @faraday_logging_config = faraday_logging_config
end

.loggerObject



23
24
25
# File 'lib/turbovax.rb', line 23

def self.logger
  @logger ||= Logger.new($stdout, level: Logger::INFO)
end

.logger=(logger) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/turbovax.rb', line 27

def self.logger=(logger)
  if logger.nil?
    self.logger.level = Logger::FATAL
    return self.logger
  end

  @logger = logger
end

.twitter_credentialsObject

Raises:

  • (NotImplementedError)


46
47
48
49
50
# File 'lib/turbovax.rb', line 46

def self.twitter_credentials
  raise NotImplementedError, "no twitter credentials provided" if @twitter_credentials.nil?

  @twitter_credentials
end

.twitter_credentials=(twitter_credentials) ⇒ Object



52
53
54
# File 'lib/turbovax.rb', line 52

def self.twitter_credentials=(twitter_credentials)
  @twitter_credentials = twitter_credentials
end

.twitter_enabledObject



36
37
38
39
40
# File 'lib/turbovax.rb', line 36

def self.twitter_enabled
  # enable twitter by default
  @twitter_enabled = true if @twitter_enabled.nil?
  @twitter_enabled
end

.twitter_enabled=(twitter_enabled) ⇒ Object



42
43
44
# File 'lib/turbovax.rb', line 42

def self.twitter_enabled=(twitter_enabled)
  @twitter_enabled = twitter_enabled
end