Class: TrailGuide::Adapters::Participants::Anonymous::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/trail_guide/adapters/participants/anonymous.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, config) ⇒ Adapter

Returns a new instance of Adapter.



28
29
30
31
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 28

def initialize(context, config)
  @context = context
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



26
27
28
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 26

def config
  @config
end

#contextObject (readonly)

Returns the value of attribute context.



26
27
28
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 26

def context
  @context
end

Instance Method Details

#[](key) ⇒ Object



33
34
35
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 33

def [](key)
  hash[key]
end

#[]=(key, value) ⇒ Object



37
38
39
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 37

def []=(key, value)
  hash[key] = value
end

#delete(key) ⇒ Object



41
42
43
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 41

def delete(key)
  hash.delete(key)
end

#destroy!Object



45
46
47
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 45

def destroy!
  @hash = nil
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 53

def key?(key)
  hash.key?(key)
end

#keysObject



49
50
51
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 49

def keys
  hash.keys
end

#to_hObject



57
58
59
# File 'lib/trail_guide/adapters/participants/anonymous.rb', line 57

def to_h
  hash.to_h
end