class PragmaticQL::IncludeModel

Public Class Methods

new(include_hash) click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 3
def initialize(include_hash)
  @include_hash = include_hash
end

Public Instance Methods

empty?() click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 24
def empty?
  level_keys.empty?
end
for(node_name) click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 7
def for(node_name)
  node_hash = @include_hash.fetch(node_name.to_sym) { {} }
  IncludeModel.new(node_hash)
end
inclusive_of?(key_name) click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 12
def inclusive_of?(key_name)
  level_keys.include?(key_name.to_sym)
end
inclusive_of_any?() click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 20
def inclusive_of_any?
  level_keys.any?
end
inspect() click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 28
def inspect
  "<#IncludeModel #{@include_hash.inspect}>"
end
level_keys() click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 36
def level_keys
  @include_hash.keys
end
or(other) click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 32
def or(other)
  self.empty? ? other : self
end
pagination() click to toggle source
# File lib/pragmatic_ql/include_model.rb, line 16
def pagination
  @pagination ||= Pagination.new(self)
end