Class: Daidai::View

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

Overview

A polarity/formality lens over a Word, returned by Word#polite etc. Calling a form name on it applies the accumulated modifiers; modifiers chain.

Instance Method Summary collapse

Constructor Details

#initialize(word, negative:, polite:) ⇒ View

Returns a new instance of View.



116
117
118
119
120
# File 'lib/daidai/word.rb', line 116

def initialize(word, negative:, polite:)
  @word     = word
  @negative = negative
  @polite   = polite
end

Instance Method Details

#affirmativeObject



125
# File 'lib/daidai/word.rb', line 125

def affirmative = View.new(@word, negative: false, polite: @polite)

#negativeObject



124
# File 'lib/daidai/word.rb', line 124

def negative    = View.new(@word, negative: true, polite: @polite)

#plainObject



123
# File 'lib/daidai/word.rb', line 123

def plain       = View.new(@word, negative: @negative, polite: false)

#politeObject



122
# File 'lib/daidai/word.rb', line 122

def polite      = View.new(@word, negative: @negative, polite: true)