Class: UniversalID::PrepackDatabaseOptions
- Inherits:
-
Object
- Object
- UniversalID::PrepackDatabaseOptions
- Defined in:
- lib/universalid/prepack_database_options.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #decrement_current_depth! ⇒ Object
- #descendant_depth ⇒ Object
- #exclude_changes? ⇒ Boolean
- #exclude_descentants? ⇒ Boolean
- #exclude_keys? ⇒ Boolean
- #exclude_timestamps? ⇒ Boolean
- #include_changes? ⇒ Boolean
- #include_descendants? ⇒ Boolean
- #include_keys? ⇒ Boolean
- #include_timestamps? ⇒ Boolean
- #increment_current_depth! ⇒ Object
-
#initialize(settings) ⇒ PrepackDatabaseOptions
constructor
A new instance of PrepackDatabaseOptions.
- #to_h ⇒ Object
Constructor Details
#initialize(settings) ⇒ PrepackDatabaseOptions
Returns a new instance of PrepackDatabaseOptions.
4 5 6 |
# File 'lib/universalid/prepack_database_options.rb', line 4 def initialize(settings) @settings = settings end |
Instance Attribute Details
#current_depth ⇒ Object
42 43 44 |
# File 'lib/universalid/prepack_database_options.rb', line 42 def current_depth @settings.current_depth ||= 0 end |
Instance Method Details
#decrement_current_depth! ⇒ Object
51 52 53 54 |
# File 'lib/universalid/prepack_database_options.rb', line 51 def decrement_current_depth! @settings.current_depth ||= 0 @settings.current_depth = @settings.current_depth -= 1 end |
#descendant_depth ⇒ Object
36 37 38 |
# File 'lib/universalid/prepack_database_options.rb', line 36 def descendant_depth @settings.descendant_depth ||= 0 end |
#exclude_changes? ⇒ Boolean
32 33 34 |
# File 'lib/universalid/prepack_database_options.rb', line 32 def exclude_changes? !include_changes? end |
#exclude_descentants? ⇒ Boolean
60 61 62 |
# File 'lib/universalid/prepack_database_options.rb', line 60 def exclude_descentants? !include_descendants? end |
#exclude_keys? ⇒ Boolean
16 17 18 |
# File 'lib/universalid/prepack_database_options.rb', line 16 def exclude_keys? !include_keys? end |
#exclude_timestamps? ⇒ Boolean
24 25 26 |
# File 'lib/universalid/prepack_database_options.rb', line 24 def ! end |
#include_changes? ⇒ Boolean
28 29 30 |
# File 'lib/universalid/prepack_database_options.rb', line 28 def include_changes? !!@settings.include_changes end |
#include_descendants? ⇒ Boolean
56 57 58 |
# File 'lib/universalid/prepack_database_options.rb', line 56 def include_descendants? !!@settings.include_descendants end |
#include_keys? ⇒ Boolean
12 13 14 |
# File 'lib/universalid/prepack_database_options.rb', line 12 def include_keys? !!@settings.include_keys end |
#include_timestamps? ⇒ Boolean
20 21 22 |
# File 'lib/universalid/prepack_database_options.rb', line 20 def !!@settings. end |
#increment_current_depth! ⇒ Object
46 47 48 49 |
# File 'lib/universalid/prepack_database_options.rb', line 46 def increment_current_depth! @settings.current_depth ||= 0 @settings.current_depth = @settings.current_depth += 1 end |
#to_h ⇒ Object
8 9 10 |
# File 'lib/universalid/prepack_database_options.rb', line 8 def to_h @settings.to_h end |