Class: Anon::CSV::Columns
- Inherits:
-
Object
- Object
- Anon::CSV::Columns
- Defined in:
- lib/anon/csv/columns.rb
Overview
Encapsulates the logic required to choose and format the list of columns to be anonomised
Instance Method Summary collapse
-
#initialize(columns, headers) ⇒ Columns
constructor
Initialzes a new instance of Columns.
-
#to_anonymise ⇒ Array<String,Integer>
Returns the columns that should be anonomised, if the object was initialized without a predefined list of columns then returns a guess based on the list of headers.
Constructor Details
#initialize(columns, headers) ⇒ Columns
Initialzes a new instance of Columns
11 12 13 |
# File 'lib/anon/csv/columns.rb', line 11 def initialize(columns, headers) @columns, @headers = columns, headers end |
Instance Method Details
#to_anonymise ⇒ Array<String,Integer>
Returns the columns that should be anonomised, if the object was initialized without a predefined list of columns then returns a guess based on the list of headers.
18 19 20 |
# File 'lib/anon/csv/columns.rb', line 18 def to_anonymise @_to_anonymise ||= indexes || columns || best_guess end |