Class: ChatCorrect::Possessive

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_a:, token_b:) ⇒ Possessive

Returns a new instance of Possessive.



4
5
6
7
# File 'lib/chat_correct/possessive.rb', line 4

def initialize(token_a:, token_b:)
  @token_a = token_a
  @token_b = token_b
end

Instance Attribute Details

#token_aObject (readonly)

Returns the value of attribute token_a.



3
4
5
# File 'lib/chat_correct/possessive.rb', line 3

def token_a
  @token_a
end

#token_bObject (readonly)

Returns the value of attribute token_b.



3
4
5
# File 'lib/chat_correct/possessive.rb', line 3

def token_b
  @token_b
end

Instance Method Details

#possessive?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
# File 'lib/chat_correct/possessive.rb', line 9

def possessive?
  check_for_possessive(token_a, token_b, "ƪ") ||
  check_for_possessive(token_b, token_a, "ƪ") ||
  check_for_possessive(token_a, token_b, "") ||
  check_for_possessive(token_b, token_a, "")
end