Sha256: f0c22a325d2921346fb8866a7ce8eac044bac3975120a11e6963b9049d08f757

Contents?: true

Size: 450 Bytes

Versions: 2

Compression:

Stored size: 450 Bytes

Contents

module Troles::Common
  class Config
    module Schema
      module Helpers
        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

        def boolean? value
          [true, false].include? value
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
troles-0.6.1 lib/troles/common/config/schema/helpers.rb
troles-0.6.0 lib/troles/common/config/schema/helpers.rb