Class: Declension::Wrappers::String

Inherits:
Object
  • Object
show all
Defined in:
lib/declension/wrappers/string.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#stringObject

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, options)
  string.split(" ").map{|word| Declension::Word.new(word).inflect(grammar_case, options) }.join(" ")
end