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.



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

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.



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

def elements
  @elements
end

#languageObject

Returns the value of attribute language.



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

def language
  @language
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end

#translationsObject

Returns the value of attribute translations.



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

def translations
  @translations
end

Instance Method Details

#runObject



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

def run
  language.join
end