Sha256: 5d13c774272f9a77970e9cf4b179482431978c74a1ebfd248f8563abe7d719bd
Contents?: true
Size: 794 Bytes
Versions: 9
Compression:
Stored size: 794 Bytes
Contents
module Scrivito # # This class represents a definition of an attribute. # # @api private # class AttributeDefinition # # @!attribute [r] name # @api private # @return [Symbol] the name of the attribute. # # @!attribute [r] type # @api private # @return [Symbol] the type of the attribute. # attr_reader :name, :type def initialize(name, type, options = {}) @name, @type, @options = name, type, options end # # Allowed values for an attribute. # # @api private # @return [[String], nil] allowed values if type is +enum+ or +multienum+ or +nil+ otherwise. # If no values have been specified, then an empty array will be returned. # def values if type == :enum || type == :multienum @options[:values] || [] end end end end
Version data entries
9 entries across 9 versions & 1 rubygems