Class: NumbersAndWords::Strategies::ArrayJoiner::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/numbers_and_words/strategies/array_joiner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements, options = {}) ⇒ Base

Returns a new instance of Base.



11
12
13
14
15
16
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 11

def initialize(elements, options = {})
  @elements = elements
  @options = options
  @translations = Translations.factory
  @language = Languages.factory(self)
end

Instance Attribute Details

#elementsObject

Returns the value of attribute elements.



9
10
11
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 9

def elements
  @elements
end

#languageObject

Returns the value of attribute language.



9
10
11
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 9

def language
  @language
end

#optionsObject

Returns the value of attribute options.



9
10
11
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 9

def options
  @options
end

#translationsObject

Returns the value of attribute translations.



9
10
11
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 9

def translations
  @translations
end

Instance Method Details

#runObject



18
19
20
# File 'lib/numbers_and_words/strategies/array_joiner.rb', line 18

def run
  language.join
end