Module: Anonymize
- Defined in:
- lib/anonymize.rb,
lib/anonymize/version.rb
Defined Under Namespace
Modules: GoogleNews Classes: SQL
Constant Summary collapse
- VERSION =
"0.0.1"
Class Attribute Summary collapse
-
.connection ⇒ Object
Returns the value of attribute connection.
-
.definition ⇒ Object
Returns the value of attribute definition.
-
.options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
- .column(column_name, &block) ⇒ Object
- .define(connection, options = {}, &block) ⇒ Object
- .table(table_name, options = {}, &block) ⇒ Object
Class Attribute Details
.connection ⇒ Object
Returns the value of attribute connection.
7 8 9 |
# File 'lib/anonymize.rb', line 7 def connection @connection end |
.definition ⇒ Object
Returns the value of attribute definition.
7 8 9 |
# File 'lib/anonymize.rb', line 7 def definition @definition end |
.options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/anonymize.rb', line 7 def @options end |
Class Method Details
.column(column_name, &block) ⇒ Object
23 24 25 |
# File 'lib/anonymize.rb', line 23 def column(column_name, &block) self.definition[@table_name][:columns][column_name] = block end |
.define(connection, options = {}, &block) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/anonymize.rb', line 9 def define(connection, = {}, &block) self. = self.connection = connection self.definition = {} class_eval &block Anonymize::SQL.run!(connection, , self.definition) end |
.table(table_name, options = {}, &block) ⇒ Object
17 18 19 20 21 |
# File 'lib/anonymize.rb', line 17 def table(table_name, = {}, &block) @table_name = table_name self.definition[@table_name] = {columns: {}, options: } class_eval &block end |