Class: Transactionable::RemoteEntity
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Transactionable::RemoteEntity
show all
- Defined in:
- app/models/transactionable/remote_entity.rb
Instance Method Summary
collapse
Instance Method Details
#build_or_update_remote ⇒ Object
7
8
9
|
# File 'app/models/transactionable/remote_entity.rb', line 7
def build_or_update_remote
raise "Not Implemented"
end
|
#build_remote ⇒ Object
15
16
17
|
# File 'app/models/transactionable/remote_entity.rb', line 15
def build_remote
raise "Not Implemented"
end
|
#destroy_remote ⇒ Object
37
38
39
40
|
# File 'app/models/transactionable/remote_entity.rb', line 37
def destroy_remote
re = self.fetch
re.unstore if re
end
|
#fetch ⇒ Object
27
28
29
30
31
|
# File 'app/models/transactionable/remote_entity.rb', line 27
def fetch
if synced?
"#{self.service_name}::#{remote_entity_type}".constantize.find(self.uri)
end
end
|
#remote_entity_type ⇒ Object
33
34
35
|
# File 'app/models/transactionable/remote_entity.rb', line 33
def remote_entity_type
"#{self.class.name.gsub("Transactionable::Remote","")}"
end
|
#service_name ⇒ Object
11
12
13
|
# File 'app/models/transactionable/remote_entity.rb', line 11
def service_name
read_attribute(:service_name) || "Balanced"
end
|
#synced? ⇒ Boolean
23
24
25
|
# File 'app/models/transactionable/remote_entity.rb', line 23
def synced?
!!self.uri
end
|
#update_remote ⇒ Object
19
20
21
|
# File 'app/models/transactionable/remote_entity.rb', line 19
def update_remote
raise "Not Implemented"
end
|