Module: Dogo

Defined in:
lib/dogo.rb,
lib/dogo/url.rb,
lib/dogo/server.rb,
lib/dogo/version.rb

Defined Under Namespace

Classes: Server, Url

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Set the API Key that will be used to create new URLs.



26
27
28
# File 'lib/dogo.rb', line 26

def api_key
  @api_key
end

.default_urlObject

Set the default URL. The ‘GET /` route will redirect to it.



30
31
32
# File 'lib/dogo.rb', line 30

def default_url
  @default_url
end

.hostObject

Set the default host that will be used to construct the shortened url.



34
35
36
# File 'lib/dogo.rb', line 34

def host
  @host
end

Class Method Details

.redisObject

Return the Redis connection. If no connection has been set, connects to localhost.



14
15
16
# File 'lib/dogo.rb', line 14

def self.redis
  @redis ||= Redis.new
end

.redis=(redis) ⇒ Object

Set the Redis connection.



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

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