Module: Troles::Common::Config::Schema::Helpers
- Included in:
- Troles::Common::Config::Schema
- Defined in:
- lib/troles/common/config/schema/helpers.rb
Instance Method Summary collapse
Instance Method Details
#boolean?(value) ⇒ Boolean
11 12 13 |
# File 'lib/troles/common/config/schema/helpers.rb', line 11 def boolean? value [true, false].include? value end |
#valid_field_name?(name) ⇒ Boolean
5 6 7 8 9 |
# File 'lib/troles/common/config/schema/helpers.rb', line 5 def valid_field_name? name return false if !name || name.empty? raise ArgumentException, "Role field must not be named role or roles as these names are reserved by troles!" if [:role, :roles].include? name.to_sym true end |