Module: Memcached::Behaviors

Included in:
Connection
Defined in:
lib/memcached/behaviors.rb,
ext/memcached/behavior.c

Instance Method Summary collapse

Instance Method Details

#get_behavior(behavior) ⇒ Object


11
12
13
# File 'lib/memcached/behaviors.rb', line 11

def get_behavior(behavior)
  _get_behavior(convert_behavior(behavior))
end

#set_behavior(behavior, value) ⇒ Object


3
4
5
6
7
8
9
# File 'lib/memcached/behaviors.rb', line 3

def set_behavior(behavior, value)
  behavior = convert_behavior(behavior)
  value = convert_value(behavior, value)
  _set_behavior(behavior, value)
rescue Memcached::Deprecated
  warn "Behavior #{behavior_string} is deprecated, and won't work anymore."
end

#set_behaviors(hash) ⇒ Object


15
16
17
# File 'lib/memcached/behaviors.rb', line 15

def set_behaviors(hash)
  hash.each { |key, value| set_behavior(key, value) } if hash
end