class Elastify::Model

Attributes

opt_decode[RW]
opt_encode[RW]
opt_index[RW]
opt_mapping[RW]
opt_scroll_timeout[RW]
opt_type[RW]

Public Instance Methods

decode(&block) click to toggle source
# File lib/elastify/model.rb, line 26
def decode(&block)
    @opt_decode = block if block_given?
end
encode(&block) click to toggle source
# File lib/elastify/model.rb, line 22
def encode(&block)
    @opt_encode = block if block_given?
end
index(index) click to toggle source
# File lib/elastify/model.rb, line 5
def index(index)
    @opt_index = index
end
mapping(&block) click to toggle source
# File lib/elastify/model.rb, line 13
def mapping(&block)
    @opt_mapping = block.call() if block_given?
end
mapping_file(file_name) click to toggle source
# File lib/elastify/model.rb, line 17
def mapping_file(file_name)
    file_path = file_name.instance_of?(Pathname) ? file_name : Rails.root.join('config', 'elastify', 'mappings', file_name)
    @opt_mapping = JSON.parse(File.read(file_path)).deep_symbolize_keys if File.exist?(file_path)
end
scroll_timeout(scroll_timeout) click to toggle source
# File lib/elastify/model.rb, line 30
def scroll_timeout(scroll_timeout)
    @opt_scroll_timeout = scroll_timeout
end
type(type) click to toggle source
# File lib/elastify/model.rb, line 9
def type(type)
    @opt_type = type
end