Class: Katsuyoujin::Base
- Inherits:
-
Object
- Object
- Katsuyoujin::Base
- Defined in:
- lib/katsuyoujin/base.rb
Instance Attribute Summary collapse
-
#base_letter ⇒ Object
readonly
Returns the value of attribute base_letter.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #conjugate(category: nil, hiragana: true) ⇒ Object
-
#initialize(verb, base_letter) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(verb, base_letter) ⇒ Base
Returns a new instance of Base.
5 6 7 8 |
# File 'lib/katsuyoujin/base.rb', line 5 def initialize(verb, base_letter) @verb = verb @base_letter = base_letter end |
Instance Attribute Details
#base_letter ⇒ Object (readonly)
Returns the value of attribute base_letter.
3 4 5 |
# File 'lib/katsuyoujin/base.rb', line 3 def base_letter @base_letter end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
3 4 5 |
# File 'lib/katsuyoujin/base.rb', line 3 def verb @verb end |
Instance Method Details
#conjugate(category: nil, hiragana: true) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/katsuyoujin/base.rb', line 10 def conjugate(category: nil, hiragana: true) case category || verb.category when 'ichidan' then ichidan_base(base_letter, hiragana: hiragana) when 'godan' then godan_base(base_letter, hiragana: hiragana) when 'suru', 'kuru' then irregular_base(base_letter, hiragana: hiragana) end end |