Class: NATOPhone::Encoder

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

Overview

End of class Base

Instance Attribute Summary collapse

Attributes inherited from Base

#args, #translate, #yell

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Encoder

Returns a new instance of Encoder.



37
38
39
40
41
42
43
# File 'lib/app.rb', line 37

def initialize(args)
  super(args)
  @dic = otan_alphabet_encode()
  @encode = convert(args)
  @translate = @encode.join(' ')
  @yell = @translate.upcase
end

Instance Attribute Details

#encodeObject

Returns the value of attribute encode.



35
36
37
# File 'lib/app.rb', line 35

def encode
  @encode
end

Instance Method Details

#to_aObject



58
59
60
# File 'lib/app.rb', line 58

def to_a
  @encode
end

#to_jsonObject



45
46
47
48
49
50
51
52
# File 'lib/app.rb', line 45

def to_json
  {
    'args' => @args,
    'encode' => @encode,
    'translate' => @translate,
    'yell' => @yell
  }.to_json
end

#to_sObject



54
55
56
# File 'lib/app.rb', line 54

def to_s
  @translate
end