lib/picky/wrappers/category/location.rb in picky-3.4.3 vs lib/picky/wrappers/category/location.rb in picky-3.5.0

- old
+ new

@@ -4,26 +4,31 @@ module Location # THINK Is this the best way to do this? # - def self.wrap category, grid, precision = 1 - wrapped_exact = Wrappers::Bundle::Location.new category.exact, grid: grid, precision: precision - new_source = Wrappers::Sources::Location.new category.source, grid, precision + def self.wrap category, grid, precision = 1, anchor = 0.0 + wrapped_exact = Wrappers::Bundle::Location.new category.exact, grid: grid, precision: precision, anchor: anchor category.class_eval do + + # Uses a basic tokenizer. + # + def tokenizer + @tokenizer ||= Tokenizer.new + end + + # Both use the exact index. + # + # TODO Necessary to wrap? + # define_method :exact do wrapped_exact end define_method :partial do wrapped_exact end - def tokenizer - @tokenizer ||= Tokenizer.new - end - define_method :source do - new_source - end + end end end \ No newline at end of file