Class: Masking::Config::TargetColumns::Column
- Inherits:
-
Object
- Object
- Masking::Config::TargetColumns::Column
- Defined in:
- lib/masking/config/target_columns/column.rb
Defined Under Namespace
Classes: ColumnNameIsNil
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
-
#method_value ⇒ Object
readonly
Returns the value of attribute method_value.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, table_name:, method_value:) ⇒ Column
constructor
A new instance of Column.
- #masked_value ⇒ Object
Constructor Details
#initialize(name, table_name:, method_value:) ⇒ Column
Returns a new instance of Column.
12 13 14 15 16 17 18 19 |
# File 'lib/masking/config/target_columns/column.rb', line 12 def initialize(name, table_name:, method_value:) raise ColumnNameIsNil if name.nil? @name = name.to_sym @table_name = table_name.to_sym @method_value = method_value @method = Method.new(method_value) end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
10 11 12 |
# File 'lib/masking/config/target_columns/column.rb', line 10 def index @index end |
#method_value ⇒ Object (readonly)
Returns the value of attribute method_value.
9 10 11 |
# File 'lib/masking/config/target_columns/column.rb', line 9 def method_value @method_value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/masking/config/target_columns/column.rb', line 9 def name @name end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
9 10 11 |
# File 'lib/masking/config/target_columns/column.rb', line 9 def table_name @table_name end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 |
# File 'lib/masking/config/target_columns/column.rb', line 25 def ==(other) name == other.name && table_name == other.table_name && method_value == other.method_value end |
#masked_value ⇒ Object
21 22 23 |
# File 'lib/masking/config/target_columns/column.rb', line 21 def masked_value method.call end |