Class: Wixy::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ Config

Returns a new instance of Config.

Yields:

  • (_self)

Yield Parameters:

  • _self (Wixy::Config)

    the object that the method was called on



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

#cipherObject

Returns the value of attribute cipher.



3
4
5
# File 'lib/wixy/config.rb', line 3

def cipher
  @cipher
end

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/wixy/config.rb', line 4

def key
  @key
end

#preserveObject

Returns the value of attribute preserve.



6
7
8
# File 'lib/wixy/config.rb', line 6

def preserve
  @preserve
end

#shiftObject

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

Returns:

  • (Boolean)


28
29
30
# File 'lib/wixy/config.rb', line 28

def cipher?(name)
  ciphers.include? name.to_sym
end

#ciphersObject

An array of available ciphers



33
34
35
# File 'lib/wixy/config.rb', line 33

def ciphers
  [:caesar, :vigenere]
end