Class: Pseudonymize::Name
- Inherits:
-
Object
- Object
- Pseudonymize::Name
- Defined in:
- lib/pseudonymize/name.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, **options) ⇒ Name
constructor
A new instance of Name.
- #result ⇒ Object
Constructor Details
#initialize(name, **options) ⇒ Name
Returns a new instance of Name.
5 6 7 8 |
# File 'lib/pseudonymize/name.rb', line 5 def initialize(name, **) @name = name @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/pseudonymize/name.rb', line 3 def @options end |
Instance Method Details
#result ⇒ Object
10 11 12 13 14 |
# File 'lib/pseudonymize/name.rb', line 10 def result @name.split.map do |name| "#{name[0]}#{[:censor] * (name.length - 1)}" end.join(' ') end |