Module: Dogo
- Defined in:
- lib/dogo.rb,
lib/dogo/url.rb,
lib/dogo/server.rb,
lib/dogo/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.api_key ⇒ Object
Set the API Key that will be used to create new URLs.
-
.default_url ⇒ Object
Set the default URL.
-
.host ⇒ Object
Set the default host that will be used to construct the shortened url.
Class Method Summary collapse
-
.redis ⇒ Object
Return the Redis connection.
-
.redis=(redis) ⇒ Object
Set the Redis connection.
Class Attribute Details
.api_key ⇒ Object
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_url ⇒ Object
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 |
.host ⇒ Object
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
.redis ⇒ Object
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 |