Class: LooseTightDictionary::I

Inherits:
Object
  • Object
show all
Defined in:
lib/loose_tight_dictionary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp, str, case_sensitive) ⇒ I

Returns a new instance of I.



266
267
268
269
270
271
# File 'lib/loose_tight_dictionary.rb', line 266

def initialize(regexp, str, case_sensitive)
  @regexp = regexp
  @str = str
  @identity = regexp.match(str).captures.compact.join
  @identity = @identity.downcase if case_sensitive
end

Instance Attribute Details

#case_sensitiveObject (readonly)

Returns the value of attribute case_sensitive.



265
266
267
# File 'lib/loose_tight_dictionary.rb', line 265

def case_sensitive
  @case_sensitive
end

#identityObject (readonly)

Returns the value of attribute identity.



265
266
267
# File 'lib/loose_tight_dictionary.rb', line 265

def identity
  @identity
end

#regexpObject (readonly)

Returns the value of attribute regexp.



265
266
267
# File 'lib/loose_tight_dictionary.rb', line 265

def regexp
  @regexp
end

#strObject (readonly)

Returns the value of attribute str.



265
266
267
# File 'lib/loose_tight_dictionary.rb', line 265

def str
  @str
end