Class: RubySpeech::GRXML::Match

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_speech/grxml/match.rb

Direct Known Subclasses

MaxMatch

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Match

Returns a new instance of Match.


6
7
8
# File 'lib/ruby_speech/grxml/match.rb', line 6

def initialize(options = {})
  options.each_pair { |k, v| self.send :"#{k}=", v }
end

Instance Attribute Details

#confidenceObject

Returns the value of attribute confidence


4
5
6
# File 'lib/ruby_speech/grxml/match.rb', line 4

def confidence
  @confidence
end

#interpretationObject

Returns the value of attribute interpretation


4
5
6
# File 'lib/ruby_speech/grxml/match.rb', line 4

def interpretation
  @interpretation
end

#modeObject

Returns the value of attribute mode


4
5
6
# File 'lib/ruby_speech/grxml/match.rb', line 4

def mode
  @mode
end

#utteranceObject

Returns the value of attribute utterance


4
5
6
# File 'lib/ruby_speech/grxml/match.rb', line 4

def utterance
  @utterance
end

Instance Method Details

#eql?(o) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)

10
11
12
# File 'lib/ruby_speech/grxml/match.rb', line 10

def eql?(o)
  o.instance_of?(self.class) && [:mode, :confidence, :utterance, :interpretation].all? { |f| self.__send__(f) == o.__send__(f) }
end