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