Class: Verb

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Verb

Returns a new instance of Verb.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/arabic_conjugator.rb', line 13

def initialize(opts)
  @opts = opts
  @root1 = opts[:root1]
  @root2 = opts[:root2]
  @root3 = opts[:root3]
  @pronoun = opts[:pronoun]
  @tense = opts[:tense]
  @form = opts[:form]
  @types = find_types
  @base = find_base
end

Instance Attribute Details

#baseObject (readonly)

Returns the value of attribute base.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def base
  @base
end

#formObject (readonly)

Returns the value of attribute form.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def form
  @form
end

#optsObject (readonly)

Returns the value of attribute opts.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def opts
  @opts
end

#pronounObject (readonly)

Returns the value of attribute pronoun.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def pronoun
  @pronoun
end

#root1Object (readonly)

Returns the value of attribute root1.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def root1
  @root1
end

#root2Object (readonly)

Returns the value of attribute root2.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def root2
  @root2
end

#root3Object (readonly)

Returns the value of attribute root3.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def root3
  @root3
end

#tenseObject (readonly)

Returns the value of attribute tense.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def tense
  @tense
end

#typesObject (readonly)

Returns the value of attribute types.



11
12
13
# File 'lib/arabic_conjugator.rb', line 11

def types
  @types
end

Instance Method Details

#conjugateObject



37
38
39
40
# File 'lib/arabic_conjugator.rb', line 37

def conjugate
  @tense = find_tense
  @tense.conjugate
end

#find_baseObject



29
30
31
# File 'lib/arabic_conjugator.rb', line 29

def find_base
  BaseFactory.new(self).load_base
end

#find_tenseObject



33
34
35
# File 'lib/arabic_conjugator.rb', line 33

def find_tense
  TenseFactory.new(self).create_tense
end

#find_typesObject



25
26
27
# File 'lib/arabic_conjugator.rb', line 25

def find_types
  TypeFactory.new(@root1, @root2, @root3, @form).load_types
end