class Fluent::Counter::ArrayValidator

Public Instance Methods

validate_key!(name) click to toggle source
# File lib/fluent/counter/validator.rb, line 80
def validate_key!(name)
  unless name.is_a?(String)
    raise Fluent::Counter::InvalidParams.new('The type of `key` should be String')
  end

  unless VALID_NAME.match?(name)
    raise Fluent::Counter::InvalidParams.new('`key` is the invalid format')
  end
end
validate_scope!(name) click to toggle source
# File lib/fluent/counter/validator.rb, line 90
def validate_scope!(name)
  unless name.is_a?(String)
    raise Fluent::Counter::InvalidParams.new('The type of `scope` should be String')
  end

  unless VALID_SCOPE_NAME.match?(name)
    raise Fluent::Counter::InvalidParams.new('`scope` is the invalid format')
  end
end