Class: Rabarber::Input::Role

Inherits:
Base
  • Object
show all
Defined in:
lib/rabarber/input/role.rb

Constant Summary collapse

REGEX =
/\A[a-z0-9_]+\z/

Instance Attribute Summary

Attributes inherited from Base

#error_message, #error_type, #value

Instance Method Summary collapse

Methods inherited from Base

#initialize, #process

Constructor Details

This class inherits a constructor from Rabarber::Input::Base

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/rabarber/input/role.rb', line 8

def valid?
  Rabarber::Input::Types::Symbol.new(value).valid? && value.to_s.match?(REGEX)
end