class Rawscsi::Query::Stringifier

Attributes

bool_hash[R]

Public Class Methods

new(bool_hash) click to toggle source
# File lib/rawscsi/query/stringifier.rb, line 6
def initialize(bool_hash)
  @bool_hash = bool_hash
end

Public Instance Methods

build() click to toggle source
# File lib/rawscsi/query/stringifier.rb, line 10
def build
  if compound?(bool_hash)
    Rawscsi::Stringifier::Compound.new(bool_hash).build
  else
    Rawscsi::Stringifier::Simple.new(bool_hash).build
  end
end

Private Instance Methods

compound?(value) click to toggle source
# File lib/rawscsi/query/stringifier.rb, line 20
def compound?(value)
  if value.kind_of?(Hash)
    ar = value.keys
    ar.include?(:and) || ar.include?(:or)
  else
    false
  end
end