Sha256: 2a519b0a47cc9d494014cf78edba6ef6ee4828f7fd3b65f3b85f072653490242

Contents?: true

Size: 586 Bytes

Versions: 6

Compression:

Stored size: 586 Bytes

Contents

module GoldenFleece
  class Context
    module Schemas
      def define_schemas(attribute, schema_definitions = {})
        attribute_schema = schemas[attribute.to_sym]

        # Allow redefining individual schemas
        if attribute_schema
          schema_definitions.each do |schema_name, schema_definition|
            schemas[attribute.to_sym][schema_name.to_sym] = schema_definition
          end
        else
          schemas[attribute.to_sym] = schema_definitions
        end

        attributes << attribute unless attributes.include? attribute
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
golden_fleece-1.0.1 lib/golden_fleece/context/schemas.rb
golden_fleece-1.0.0 lib/golden_fleece/context/schemas.rb
golden_fleece-0.1.5 lib/golden_fleece/context/schemas.rb
golden_fleece-0.1.4 lib/golden_fleece/context/schemas.rb
golden_fleece-0.1.3 lib/golden_fleece/context/schemas.rb
golden_fleece-0.1.2 lib/golden_fleece/context/schemas.rb