Class: TrailGuide::Adapters::Participants::Base::Adapter
- Inherits:
-
Object
- Object
- TrailGuide::Adapters::Participants::Base::Adapter
show all
- Defined in:
- lib/trail_guide/adapters/participants/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(context, config) ⇒ Adapter
Returns a new instance of Adapter.
26
27
28
29
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 26
def initialize(context, config)
@context = context
@config = config
end
|
Instance Attribute Details
#config ⇒ Object
Also known as:
configuration
Returns the value of attribute config.
23
24
25
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 23
def config
@config
end
|
#context ⇒ Object
Returns the value of attribute context.
23
24
25
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 23
def context
@context
end
|
Instance Method Details
#[](key) ⇒ Object
36
37
38
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 36
def [](key)
raise NotImplementedError, "You must override the `[]` method in your inheriting adapter class"
end
|
#[]=(key, value) ⇒ Object
40
41
42
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 40
def []=(key, value)
raise NotImplementedError, "You must override the `[]=` method in your inheriting adapter class"
end
|
#delete(key) ⇒ Object
44
45
46
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 44
def delete(key)
raise NotImplementedError, "You must override the `delete` method in your inheriting adapter class"
end
|
#destroy! ⇒ Object
48
49
50
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 48
def destroy!
raise NotImplementedError, "You must override the `destroy!` method in your inheriting adapter class"
end
|
#key?(key) ⇒ Boolean
56
57
58
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 56
def key?(key)
raise NotImplementedError, "You must override the `key?` method in your inheriting adapter class"
end
|
#keys ⇒ Object
52
53
54
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 52
def keys
raise NotImplementedError, "You must override the `keys` method in your inheriting adapter class"
end
|
#subject ⇒ Object
Also known as:
user
31
32
33
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 31
def subject
context.try(:trailguide_user) || context.try(:current_user)
end
|
#to_h ⇒ Object
60
61
62
|
# File 'lib/trail_guide/adapters/participants/base.rb', line 60
def to_h
raise NotImplementedError, "You must override the `to_h` method in your inheriting adapter class"
end
|