Class: DataAnon::Strategy::Field::SelectFromList
- Inherits:
-
SelectFromFile
- Object
- SelectFromFile
- DataAnon::Strategy::Field::SelectFromList
- Defined in:
- lib/strategy/field/string/select_from_list.rb
Overview
Select randomly one of the values specified.
anonymize('State').using FieldStrategy::SelectFromList.new(['New York','Georgia',...])
!!!ruby
anonymize('NameTitle').using FieldStrategy::SelectFromList.new(['Mr','Mrs','Dr',...])
Instance Method Summary collapse
-
#initialize(values) ⇒ SelectFromList
constructor
A new instance of SelectFromList.
Methods inherited from SelectFromFile
Constructor Details
#initialize(values) ⇒ SelectFromList
Returns a new instance of SelectFromList.
16 17 18 |
# File 'lib/strategy/field/string/select_from_list.rb', line 16 def initialize values @values = values.class == Array ? values : [values] end |