Module: RubySmart::SimpleLogger::Extensions::Mask::InstanceMethods

Defined in:
lib/ruby_smart/simple_logger/extensions/mask.rb

Instance Method Summary collapse

Instance Method Details

#mask(mask = nil) ⇒ Hash

combined getter & setter for instances mask new mask is merged with existing

Examples:

mask
> {char: '=', length: 100}

mask(clr: :blue, length: 10)
mask
> {char: '=', length: 10, clr: :blue}

Parameters:

  • mask (nil, Hash) (defaults to: nil)

Returns:

  • (Hash)

    mask



52
53
54
55
56
# File 'lib/ruby_smart/simple_logger/extensions/mask.rb', line 52

def mask(mask = nil)
  return (@mask || self.class.mask) if mask.nil?

  @mask = (@mask || self.class.mask).merge(mask)
end