Class: Userlist::Push::Relation
- Inherits:
-
Object
- Object
- Userlist::Push::Relation
- Defined in:
- lib/userlist/push/relation.rb
Instance Attribute Summary collapse
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #config ⇒ Object
- #endpoint ⇒ Object
- #from_payload(payload, config = self.config) ⇒ Object
-
#initialize(scope, type, operations = []) ⇒ Relation
constructor
A new instance of Relation.
- #strategy ⇒ Object
Constructor Details
#initialize(scope, type, operations = []) ⇒ Relation
Returns a new instance of Relation.
4 5 6 7 8 9 |
# File 'lib/userlist/push/relation.rb', line 4 def initialize(scope, type, operations = []) @scope = scope @type = type operations.each { |operation| singleton_class.send(:include, operation::ClassMethods) } end |
Instance Attribute Details
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
11 12 13 |
# File 'lib/userlist/push/relation.rb', line 11 def scope @scope end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/userlist/push/relation.rb', line 11 def type @type end |
Instance Method Details
#config ⇒ Object
25 26 27 |
# File 'lib/userlist/push/relation.rb', line 25 def config scope.config end |
#endpoint ⇒ Object
17 18 19 |
# File 'lib/userlist/push/relation.rb', line 17 def endpoint type.endpoint end |
#from_payload(payload, config = self.config) ⇒ Object
13 14 15 |
# File 'lib/userlist/push/relation.rb', line 13 def from_payload(payload, config = self.config) type.from_payload(payload, config) end |
#strategy ⇒ Object
21 22 23 |
# File 'lib/userlist/push/relation.rb', line 21 def strategy scope.strategy end |