Module: Obfuscate
- Defined in:
- lib/obfuscate/version.rb,
lib/obfuscate.rb,
lib/obfuscate/obfuscatable.rb
Overview
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Defined Under Namespace
Modules: Obfuscatable Classes: Config, Crypt
Constant Summary collapse
- VERSION =
"0.0.7"
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
Class Method Summary collapse
-
.clarify(text, options = {}) ⇒ String
Clarify obfuscated text.
-
.cryptor(options = {}) ⇒ Obfuscate::Crypt
Create instance of Obfuscate::Crypt.
-
.obfuscate(text, options = {}) ⇒ String
Obfuscate text.
-
.setup(options = {}, &blk) ⇒ Obfuscate::Config
Setup Obfuscate passing in a hash and/or block.
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
23 24 25 |
# File 'lib/obfuscate.rb', line 23 def config @config end |
Class Method Details
.clarify(text, options = {}) ⇒ String
Clarify obfuscated text. Depends on Obfuscate.setup to be called first
39 40 41 |
# File 'lib/obfuscate.rb', line 39 def clarify(text, = {} ) cryptor( ).clarify( text ) end |
.cryptor(options = {}) ⇒ Obfuscate::Crypt
Create instance of Obfuscate::Crypt. Depends on Obfuscate.setup to be called first
47 48 49 |
# File 'lib/obfuscate.rb', line 47 def cryptor( = {} ) Obfuscate::Crypt.new( @config.apply( ) ) end |
.obfuscate(text, options = {}) ⇒ String
Obfuscate text. Depends on Obfuscate.setup to be called first
30 31 32 |
# File 'lib/obfuscate.rb', line 30 def obfuscate(text, = {} ) cryptor( ).obfuscate( text ) end |
.setup(options = {}, &blk) ⇒ Obfuscate::Config
Setup Obfuscate passing in a hash and/or block
60 61 62 |
# File 'lib/obfuscate.rb', line 60 def setup( ={}, &blk) @config = @config.apply(, &blk) end |