Class: Zookeeper::Stat

Inherits:
Object
  • Object
show all
Defined in:
lib/zookeeper/stat.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Stat

Returns a new instance of Stat

Raises:

  • (ArgumentError)

9
10
11
12
13
14
15
# File 'lib/zookeeper/stat.rb', line 9

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

Instance Attribute Details

#aversionObject (readonly)

Returns the value of attribute aversion


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def aversion
  @aversion
end

#ctimeObject (readonly)

Returns the value of attribute ctime


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def ctime
  @ctime
end

#cversionObject (readonly)

Returns the value of attribute cversion


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def cversion
  @cversion
end

#czxidObject (readonly)

Returns the value of attribute czxid


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def czxid
  @czxid
end

#dataLengthObject (readonly) Also known as: data_length

Returns the value of attribute dataLength


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def dataLength
  @dataLength
end

#ephemeralOwnerObject (readonly) Also known as: ephemeral_owner

Returns the value of attribute ephemeralOwner


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def ephemeralOwner
  @ephemeralOwner
end

#existsObject (readonly)

Returns the value of attribute exists


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def exists
  @exists
end

#mtimeObject (readonly)

Returns the value of attribute mtime


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def mtime
  @mtime
end

#mzxidObject (readonly)

Returns the value of attribute mzxid


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def mzxid
  @mzxid
end

#numChildrenObject (readonly) Also known as: num_children

Returns the value of attribute numChildren


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def numChildren
  @numChildren
end

#pzxidObject (readonly)

Returns the value of attribute pzxid


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def pzxid
  @pzxid
end

#versionObject (readonly)

Returns the value of attribute version


3
4
5
# File 'lib/zookeeper/stat.rb', line 3

def version
  @version
end

Instance Method Details

#exists?Boolean


17
18
19
# File 'lib/zookeeper/stat.rb', line 17

def exists?
  @exists
end