Class: UniversalID::PrepackDatabaseOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/universalid/prepack_database_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_depthObject



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_depthObject



36
37
38
# File 'lib/universalid/prepack_database_options.rb', line 36

def descendant_depth
  @settings.descendant_depth ||= 0
end

#exclude_changes?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/universalid/prepack_database_options.rb', line 32

def exclude_changes?
  !include_changes?
end

#exclude_descentants?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/universalid/prepack_database_options.rb', line 60

def exclude_descentants?
  !include_descendants?
end

#exclude_keys?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/universalid/prepack_database_options.rb', line 16

def exclude_keys?
  !include_keys?
end

#exclude_timestamps?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/universalid/prepack_database_options.rb', line 24

def exclude_timestamps?
  !include_timestamps?
end

#include_changes?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/universalid/prepack_database_options.rb', line 28

def include_changes?
  !!@settings.include_changes
end

#include_descendants?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/universalid/prepack_database_options.rb', line 56

def include_descendants?
  !!@settings.include_descendants
end

#include_keys?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/universalid/prepack_database_options.rb', line 12

def include_keys?
  !!@settings.include_keys
end

#include_timestamps?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/universalid/prepack_database_options.rb', line 20

def include_timestamps?
  !!@settings.include_timestamps
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_hObject



8
9
10
# File 'lib/universalid/prepack_database_options.rb', line 8

def to_h
  @settings.to_h
end