Class: NumberHumanizer::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/number_humanizer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number, **args) ⇒ Manager

Returns a new instance of Manager.



25
26
27
28
29
# File 'lib/number_humanizer.rb', line 25

def initialize(number, **args)
  @number = number
  @language = args[:language] || NumberHumanizer.language
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



23
24
25
# File 'lib/number_humanizer.rb', line 23

def args
  @args
end

#languageObject (readonly)

Returns the value of attribute language.



23
24
25
# File 'lib/number_humanizer.rb', line 23

def language
  @language
end

#numberObject (readonly)

Returns the value of attribute number.



23
24
25
# File 'lib/number_humanizer.rb', line 23

def number
  @number
end

#resultObject (readonly)

Returns the value of attribute result.



23
24
25
# File 'lib/number_humanizer.rb', line 23

def result
  @result
end

Instance Method Details

#callObject



31
32
33
34
# File 'lib/number_humanizer.rb', line 31

def call
  @result = language_service_class.new(number, **args).call.result
  self
end