Module: Nexo::Synchronizable
- Extended by:
- ActiveSupport::Concern
- Included in:
- CalendarEvent
- Defined in:
- app/models/concerns/nexo/synchronizable.rb
Defined Under Namespace
Modules: Associations, ClassMethods
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
57
58
59
60
61
62
63
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 57
def method_missing(method_name, *, &)
if method_name.in?(protocol_methods)
raise Errors::InterfaceMethodNotImplemented, method_name
end
super
end
|
Instance Method Details
#conflicted? ⇒ Boolean
74
75
76
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 74
def conflicted?
nexo_elements.conflicted.any?
end
|
#increment_sequence! ⇒ Object
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 92
def increment_sequence!
if sequence.nil?
Nexo.logger.warn("Synchronizable sequence is nil on increment_sequence!: #{self.to_gid}")
end
increment!(:sequence)
end
|
#protocol_methods ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 5
def protocol_methods
i[
sequence
]
end
|
#translate_fields(fields, for_create: false, folder: nil) ⇒ Object
87
88
89
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 87
def translate_fields(fields, for_create: false, folder: nil)
raise "must be implemented in subclass"
end
|
#update_from_fields!(fields) ⇒ Object
83
84
85
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 83
def update_from_fields!(fields)
raise "must be implemented in subclass"
end
|
#validate_synchronizable! ⇒ Object
79
80
81
|
# File 'app/models/concerns/nexo/synchronizable.rb', line 79
def validate_synchronizable!
raise "must be implemented in subclass"
end
|