Class: Redcat::Catter

Inherits:
Object
  • Object
show all
Defined in:
lib/redcat/catter.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Catter

Returns a new instance of Catter.



3
4
5
6
# File 'lib/redcat/catter.rb', line 3

def initialize(opts={})
  @redis_list = opts[:redis_list]
  @redis_url = opts[:redis_url]
end

Instance Method Details

#cat(s) ⇒ Object



8
9
10
# File 'lib/redcat/catter.rb', line 8

def cat(s)
  redis.rpush(list, s)
end

#listObject



12
13
14
# File 'lib/redcat/catter.rb', line 12

def list
  @redis_list
end

#redisObject



16
17
18
# File 'lib/redcat/catter.rb', line 16

def redis
  @redis ||= Redis.new(url: @redis_url)
end

#redis_urlObject



20
21
22
# File 'lib/redcat/catter.rb', line 20

def redis_url
  @redis_url
end