Class: Verb
- Inherits:
-
Object
- Object
- Verb
- Defined in:
- lib/arabic_conjugator.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#form ⇒ Object
readonly
Returns the value of attribute form.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#pronoun ⇒ Object
readonly
Returns the value of attribute pronoun.
-
#root1 ⇒ Object
readonly
Returns the value of attribute root1.
-
#root2 ⇒ Object
readonly
Returns the value of attribute root2.
-
#root3 ⇒ Object
readonly
Returns the value of attribute root3.
-
#tense ⇒ Object
readonly
Returns the value of attribute tense.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
- #conjugate ⇒ Object
- #find_base ⇒ Object
- #find_tense ⇒ Object
- #find_types ⇒ Object
-
#initialize(opts) ⇒ Verb
constructor
A new instance of Verb.
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
#base ⇒ Object (readonly)
Returns the value of attribute base.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def base @base end |
#form ⇒ Object (readonly)
Returns the value of attribute form.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def form @form end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def opts @opts end |
#pronoun ⇒ Object (readonly)
Returns the value of attribute pronoun.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def pronoun @pronoun end |
#root1 ⇒ Object (readonly)
Returns the value of attribute root1.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def root1 @root1 end |
#root2 ⇒ Object (readonly)
Returns the value of attribute root2.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def root2 @root2 end |
#root3 ⇒ Object (readonly)
Returns the value of attribute root3.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def root3 @root3 end |
#tense ⇒ Object (readonly)
Returns the value of attribute tense.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def tense @tense end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
11 12 13 |
# File 'lib/arabic_conjugator.rb', line 11 def types @types end |
Instance Method Details
#conjugate ⇒ Object
37 38 39 40 |
# File 'lib/arabic_conjugator.rb', line 37 def conjugate @tense = find_tense @tense.conjugate end |
#find_base ⇒ Object
29 30 31 |
# File 'lib/arabic_conjugator.rb', line 29 def find_base BaseFactory.new(self).load_base end |
#find_tense ⇒ Object
33 34 35 |
# File 'lib/arabic_conjugator.rb', line 33 def find_tense TenseFactory.new(self).create_tense end |
#find_types ⇒ Object
25 26 27 |
# File 'lib/arabic_conjugator.rb', line 25 def find_types TypeFactory.new(@root1, @root2, @root3, @form).load_types end |