Class: Yuki::Store::TokyoTyrant
- Inherits:
-
AbstractStore
- Object
- AbstractStore
- Yuki::Store::TokyoTyrant
- Defined in:
- lib/store/tyrant.rb
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ TokyoTyrant
constructor
A new instance of TokyoTyrant.
- #stat ⇒ Object
- #valid? ⇒ Boolean
Methods inherited from AbstractStore
#<<, #[], #[]=, #any?, #delete!, #empty?, #filter, #keys, #union
Constructor Details
#initialize(config = {}) ⇒ TokyoTyrant
Returns a new instance of TokyoTyrant.
6 7 8 9 |
# File 'lib/store/tyrant.rb', line 6 def initialize(config = {}) @socket = config[:socket] if config.include? :socket @host, @port = config[:host], config[:port] end |
Instance Method Details
#stat ⇒ Object
18 19 20 |
# File 'lib/store/tyrant.rb', line 18 def stat open { |db| db.stat.inject('') { |s, (k, v)| s << "#{k} => #{v}\n" } } end |
#valid? ⇒ Boolean
11 12 13 14 15 16 |
# File 'lib/store/tyrant.rb', line 11 def valid? unless(socket_valid? || host_and_port_valid?) errors.size < 2 else {} end end |