Class: Declension::Wrappers::String
- Inherits:
-
Object
- Object
- Declension::Wrappers::String
- Defined in:
- lib/declension/wrappers/string.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #inflect(grammar_case, options) ⇒ Object
-
#initialize(string) ⇒ String
constructor
A new instance of String.
Constructor Details
#initialize(string) ⇒ String
Returns a new instance of String.
6 7 8 |
# File 'lib/declension/wrappers/string.rb', line 6 def initialize(string) @string = string end |
Instance Attribute Details
#string ⇒ Object
Returns the value of attribute string.
4 5 6 |
# File 'lib/declension/wrappers/string.rb', line 4 def string @string end |
Instance Method Details
#inflect(grammar_case, options) ⇒ Object
10 11 12 |
# File 'lib/declension/wrappers/string.rb', line 10 def inflect(grammar_case, ) string.split(" ").map{|word| Declension::Word.new(word).inflect(grammar_case, ) }.join(" ") end |