Class: Wixy::Config
- Inherits:
-
Object
- Object
- Wixy::Config
- Defined in:
- lib/wixy/config.rb
Instance Attribute Summary collapse
-
#cipher ⇒ Object
Returns the value of attribute cipher.
-
#key ⇒ Object
Returns the value of attribute key.
-
#preserve ⇒ Object
Returns the value of attribute preserve.
-
#shift ⇒ Object
Returns the value of attribute shift.
Instance Method Summary collapse
- #cipher?(name) ⇒ Boolean
-
#ciphers ⇒ Object
An array of available ciphers.
-
#initialize {|_self| ... } ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize {|_self| ... } ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 |
# File 'lib/wixy/config.rb', line 8 def initialize @cipher = :caesar @shift = 3 @key = "FORTIFICATION" @preserve = false yield self if block_given? end |
Instance Attribute Details
#cipher ⇒ Object
Returns the value of attribute cipher.
3 4 5 |
# File 'lib/wixy/config.rb', line 3 def cipher @cipher end |
#key ⇒ Object
Returns the value of attribute key.
4 5 6 |
# File 'lib/wixy/config.rb', line 4 def key @key end |
#preserve ⇒ Object
Returns the value of attribute preserve.
6 7 8 |
# File 'lib/wixy/config.rb', line 6 def preserve @preserve end |
#shift ⇒ Object
Returns the value of attribute shift.
5 6 7 |
# File 'lib/wixy/config.rb', line 5 def shift @shift end |
Instance Method Details
#cipher?(name) ⇒ Boolean
28 29 30 |
# File 'lib/wixy/config.rb', line 28 def cipher?(name) ciphers.include? name.to_sym end |
#ciphers ⇒ Object
An array of available ciphers
33 34 35 |
# File 'lib/wixy/config.rb', line 33 def ciphers [:caesar, :vigenere] end |