Class: Key::SKey
Overview
Direct Known Subclasses
Constant Summary
- BASE =
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Instance Attribute Summary (collapse)
-
- (Object) alpha
readonly
Returns the value of attribute alpha.
-
- (Object) ralpha
readonly
Returns the value of attribute ralpha.
Instance Method Summary (collapse)
-
- (Object) decode(c)
decode.
-
- (Object) encode(c)
encode.
-
- (SKey) initialize(key)
constructor
A new instance of SKey.
Constructor Details
- (SKey) initialize(key)
Returns a new instance of SKey
24 25 26 27 28 |
# File 'lib/key/skey.rb', line 24 def initialize(key) super(key) @alpha = Hash.new @ralpha = Hash.new end |
Instance Attribute Details
- (Object) alpha (readonly)
Returns the value of attribute alpha
22 23 24 |
# File 'lib/key/skey.rb', line 22 def alpha @alpha end |
- (Object) ralpha (readonly)
Returns the value of attribute ralpha
22 23 24 |
# File 'lib/key/skey.rb', line 22 def ralpha @ralpha end |
Instance Method Details
- (Object) decode(c)
decode
38 39 40 |
# File 'lib/key/skey.rb', line 38 def decode(c) @ralpha[c] || c end |
- (Object) encode(c)
encode
32 33 34 |
# File 'lib/key/skey.rb', line 32 def encode(c) @alpha[c] || c end |