Sha256: 410b2e4ef70c5f77950949f47e4af0dd579ff5e7a76c977955dccd72b9d768b4

Contents?: true

Size: 711 Bytes

Versions: 28

Compression:

Stored size: 711 Bytes

Contents

module ZookeeperStat
  class Stat
    attr_reader :version, :exists, :czxid, :mzxid, :ctime, :mtime, :cversion, :aversion, :ephemeralOwner, :dataLength, :numChildren, :pzxid

    alias :ephemeral_owner :ephemeralOwner
    alias :num_children :numChildren
    alias :data_length :dataLength

    def initialize(val)
      @exists = !!val
      @czxid, @mzxid, @ctime, @mtime, @version, @cversion, @aversion,
          @ephemeralOwner, @dataLength, @numChildren, @pzxid = val if val.is_a?(Array)
      val.each { |k,v| instance_variable_set "@#{k}", v } if val.is_a?(Hash)
      raise ArgumentError unless (val.is_a?(Hash) or val.is_a?(Array) or val.nil?)
    end

    def exists?
      @exists
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
zookeeper-0.9.4 lib/zookeeper/stat.rb
zookeeper-0.9.4-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.4 lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.4-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.3 lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.3-java lib/zookeeper/stat.rb
zookeeper-0.9.3 lib/zookeeper/stat.rb
zookeeper-0.9.3-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.2 lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.2-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.1 lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.1-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.4 lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.4-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.0 lib/zookeeper/stat.rb
slyphon-zookeeper-0.9.0-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.3 lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.3-java lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.2 lib/zookeeper/stat.rb
slyphon-zookeeper-0.8.2-java lib/zookeeper/stat.rb