Class: Synchronisable::InputDescriptor Private
- Inherits:
-
Object
- Object
- Synchronisable::InputDescriptor
- Defined in:
- lib/synchronisable/input_descriptor.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Provides a set of helper methods to describe user input.
Instance Attribute Summary collapse
- #data ⇒ Object readonly private
Instance Method Summary collapse
- #array_of_ids? ⇒ Boolean private
- #element_class ⇒ Object private
- #empty? ⇒ Boolean private
-
#initialize(data) ⇒ InputDescriptor
constructor
private
A new instance of InputDescriptor.
- #local_id? ⇒ Boolean private
- #params? ⇒ Boolean private
- #remote_id? ⇒ Boolean private
Constructor Details
#initialize(data) ⇒ InputDescriptor
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of InputDescriptor.
11 12 13 |
# File 'lib/synchronisable/input_descriptor.rb', line 11 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/synchronisable/input_descriptor.rb', line 9 def data @data end |
Instance Method Details
#array_of_ids? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 34 35 36 |
# File 'lib/synchronisable/input_descriptor.rb', line 31 def array_of_ids? enumerable? && ( first_element.is_a?(String) || first_element.is_a?(Integer) ) end |
#element_class ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/synchronisable/input_descriptor.rb', line 38 def element_class first_element.try(:class) end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/synchronisable/input_descriptor.rb', line 15 def empty? @data.blank? end |
#local_id? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/synchronisable/input_descriptor.rb', line 27 def local_id? @data.is_a?(Integer) end |
#params? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/synchronisable/input_descriptor.rb', line 19 def params? @data.is_a?(Hash) end |
#remote_id? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/synchronisable/input_descriptor.rb', line 23 def remote_id? @data.is_a?(String) end |