Class: ActsAsRecursiveTree::Options::QueryOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/acts_as_recursive_tree/options/query_options.rb

Constant Summary collapse

STRATEGIES =
%i[subselect join].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



14
15
16
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 14

def condition
  @condition
end

#ensure_orderingObject (readonly)

Returns the value of attribute ensure_ordering.



15
16
17
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 15

def ensure_ordering
  @ensure_ordering
end

#query_strategyObject

Returns the value of attribute query_strategy.



15
16
17
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 15

def query_strategy
  @query_strategy
end

Class Method Details

.from {|options| ... } ⇒ Object

Yields:

  • (options)


8
9
10
11
12
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 8

def self.from
  options = new
  yield(options) if block_given?
  options
end

Instance Method Details

#depthObject



17
18
19
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 17

def depth
  @depth ||= DepthCondition.new
end

#depth_present?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 25

def depth_present?
  @depth.present?
end

#ensure_ordering!Object



21
22
23
# File 'lib/acts_as_recursive_tree/options/query_options.rb', line 21

def ensure_ordering!
  @ensure_ordering = true
end