Method: ModelTokenizer::Base#has_token

Defined in:
lib/model_tokenizer/base.rb

#has_token(*attributes) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/model_tokenizer/base.rb', line 18

def has_token(*attributes)
  options = {
    :length => @@model_tokenizer_token_length
  }.merge!(attributes.last.is_a?(Hash) ? attributes.pop : {})

  if(!options[:length].is_a?(Integer) || options[:length] < 8)
    options[:length] = @@model_tokenizer_token_length
  end

  @@model_tokenizer_token_length = options[:length]

  include InstanceMethods
end