Module: Flexi::Json

Defined in:
lib/flexi/json/loader.rb,
lib/flexi/json/dataset.rb,
lib/flexi/json/version.rb,
lib/flexi/json/searcher.rb,
lib/flexi/json/configuration.rb,
lib/flexi/json.rb

Defined Under Namespace

Classes: ConfigError, Configuration, Dataset, Loader, Searcher

Constant Summary collapse

VERSION =
"0.4.2"

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.configurationObject



13
14
15
# File 'lib/flexi/json.rb', line 13

def configuration
  @configuration ||= Flexi::Json::Configuration.instance
end

Class Method Details

.configure {|configuration| ... } ⇒ Object

Yields:



17
18
19
# File 'lib/flexi/json.rb', line 17

def configure
  yield(configuration)
end

.new(data) ⇒ Object



21
22
23
24
# File 'lib/flexi/json.rb', line 21

def new(data)
  datasets = Flexi::Json::Loader.new(data).load_data
  @searcher = Flexi::Json::Searcher.new(datasets)
end

Instance Method Details

#find_duplicates(keys) ⇒ Object



31
32
33
# File 'lib/flexi/json.rb', line 31

def find_duplicates(keys)
  @searcher.find_duplicates(keys)
end

#search(query = "", fields = nil, options: nil) ⇒ Object



27
28
29
# File 'lib/flexi/json.rb', line 27

def search(query = "", fields = nil, options: nil)
  @searcher.search(query, fields, options: options)
end