class Eiwa::Tag::Antonym

Attributes

sense_ordinal[R]
text[R]

Public Class Methods

new(text: nil, sense_ordinal: nil) click to toggle source
# File lib/eiwa/tag/antonym.rb, line 6
def initialize(text: nil, sense_ordinal: nil)
  @text = text
  @sense_ordinal = sense_ordinal
end

Public Instance Methods

==(other)
Alias for: eql?
end_self() click to toggle source
# File lib/eiwa/tag/antonym.rb, line 11
def end_self
  parts = @characters.split("・")
  @text = parts[0]
  @sense_ordinal = parts[1]&.to_i
end
eql?(other) click to toggle source
# File lib/eiwa/tag/antonym.rb, line 17
def eql?(other)
  @text == other.text &&
    @sense_ordinal == other.sense_ordinal
end
Also aliased as: ==
hash() click to toggle source
# File lib/eiwa/tag/antonym.rb, line 23
def hash
  @text.hash + @sense_ordinal.hash
end