Module: Typesense::InstanceMethods

Defined in:
lib/typesense-rails.rb

Overview

these are the instance methods included

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



1077
1078
1079
1080
1081
1082
# File 'lib/typesense-rails.rb', line 1077

def self.included(base)
  base.instance_eval do
    alias_method :index!, :typesense_index! unless method_defined? :index!
    alias_method :remove_from_index!, :typesense_remove_from_index! unless method_defined? :remove_from_index!
  end
end

Instance Method Details

#typesense_enqueue_index!Object



1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/typesense-rails.rb', line 1101

def typesense_enqueue_index!
  if typesense_options[:enqueue]
    typesense_options[:enqueue].call(self, false) unless self.class.send(:typesense_indexing_disabled?,
                                                                         typesense_options)
  else
    typesense_index!
  end
end

#typesense_enqueue_remove_from_index!Object



1092
1093
1094
1095
1096
1097
1098
1099
# File 'lib/typesense-rails.rb', line 1092

def typesense_enqueue_remove_from_index!
  if typesense_options[:enqueue]
    typesense_options[:enqueue].call(self, true) unless self.class.send(:typesense_indexing_disabled?,
                                                                        typesense_options)
  else
    typesense_remove_from_index!
  end
end

#typesense_index!Object



1084
1085
1086
# File 'lib/typesense-rails.rb', line 1084

def typesense_index!
  self.class.typesense_index!(self)
end

#typesense_remove_from_index!Object



1088
1089
1090
# File 'lib/typesense-rails.rb', line 1088

def typesense_remove_from_index!
  self.class.typesense_remove_from_index!(self)
end