Class: Prosody::StateDefinition

Inherits:
Data
  • Object
show all
Defined in:
sig/state.rbs,
lib/prosody/state.rb

Overview

Concrete immutable definition object returned by the constructor helpers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access

Returns:

  • (Object)

    the current value of access



60
61
62
# File 'lib/prosody/state.rb', line 60

def access
  @access
end

#capacityObject (readonly)

Returns the value of attribute capacity

Returns:

  • (Object)

    the current value of capacity



60
61
62
# File 'lib/prosody/state.rb', line 60

def capacity
  @capacity
end

#keyset_limitObject (readonly)

Returns the value of attribute keyset_limit

Returns:

  • (Object)

    the current value of keyset_limit



60
61
62
# File 'lib/prosody/state.rb', line 60

def keyset_limit
  @keyset_limit
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



60
61
62
# File 'lib/prosody/state.rb', line 60

def kind
  @kind
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



60
61
62
# File 'lib/prosody/state.rb', line 60

def name
  @name
end

#payloadObject (readonly)

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



60
61
62
# File 'lib/prosody/state.rb', line 60

def payload
  @payload
end

#publishedObject (readonly)

Returns the value of attribute published

Returns:

  • (Object)

    the current value of published



60
61
62
# File 'lib/prosody/state.rb', line 60

def published
  @published
end

#read_cacheObject (readonly)

Returns the value of attribute read_cache

Returns:

  • (Object)

    the current value of read_cache



60
61
62
# File 'lib/prosody/state.rb', line 60

def read_cache
  @read_cache
end

#read_uncommittedObject (readonly)

Returns the value of attribute read_uncommitted

Returns:

  • (Object)

    the current value of read_uncommitted



60
61
62
# File 'lib/prosody/state.rb', line 60

def read_uncommitted
  @read_uncommitted
end

#ttl_secondsObject (readonly)

Returns the value of attribute ttl_seconds

Returns:

  • (Object)

    the current value of ttl_seconds



60
61
62
# File 'lib/prosody/state.rb', line 60

def ttl_seconds
  @ttl_seconds
end

Instance Method Details

#to_state_configHash

Serializes this definition into the native-registration hash, omitting unset optionals so they fall back to the core defaults.

Returns:

  • (Hash)

    the registration hash for the native layer



66
67
68
69
70
71
72
73
74
# File 'lib/prosody/state.rb', line 66

def to_state_config
  config = {name: name, kind: kind, payload: payload}
  config[:ttl_seconds] = ttl_seconds unless ttl_seconds.nil?
  config[:read_uncommitted] = read_uncommitted unless read_uncommitted.nil?
  config[:published] = published unless published.nil?
  config[:keyset_limit] = keyset_limit unless keyset_limit.nil?
  config[:capacity] = capacity unless capacity.nil?
  config
end