Add Fluentd::Setting::Type::Regexp

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-06-07 17:23:22 +09:00
parent 6ef0380b3e
commit e4a33d21ae
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,17 @@
class Fluentd
module Setting
module Type
class Regexp < ActiveModel::Type::Value
def type
:regexp
end
private
def cast_value(value)
value
end
end
end
end
end

View File

@ -2,5 +2,6 @@ ActiveModel::Type.register(:array, Fluentd::Setting::Type::Array)
ActiveModel::Type.register(:enum, Fluentd::Setting::Type::Enum)
ActiveModel::Type.register(:bool, Fluentd::Setting::Type::Bool)
ActiveModel::Type.register(:hash, Fluentd::Setting::Type::Hash)
ActiveModel::Type.register(:regexp, Fluentd::Setting::Type::Hash)
ActiveModel::Type.register(:size, Fluentd::Setting::Type::Size)
ActiveModel::Type.register(:section, Fluentd::Setting::Type::Section)