Sha256: 8754c0baaf784d06a527bd7f01686a43e54f9b9169abab8df7742cea77d7d444

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

# Enhance net.sf.ehcache.Element with a more Rubyesque API.
class Java::NetSfEhcache::Element
  def self.create(key, value, options = {})
    result = self.new(key, value)
    options.each do |key, value|
      setter = "#{key}=".to_sym
      result.send(setter, value) if result.respond_to?(setter)
    end
    result
  end

  alias tti getTimeToIdle
  alias ttl getTimeToLive

  alias tti= setTimeToIdle
  alias ttl= setTimeToLive
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jruby-ehcache-1.0.0 lib/ehcache/element.rb