Sha256: c2420cb5ea69580177c498317e439f89fbc74d2ccb1a9450c58c841b7d5e73b5

Contents?: true

Size: 680 Bytes

Versions: 9

Compression:

Stored size: 680 Bytes

Contents

module IMW
  class Metadata
    module Schematized

      # The schema for this object.
      #
      # @return [IMW::Metadata::Schema, nil]
      def schema
        @schema
      end

      # Set a new schema for this object.
      #
      # Will call the object's +validate_schema!+ hook which should
      # check the record and take the appropriate action if it's
      # invalid.
      #
      # @param [Array, IMW::Metadata::Schema] new_schema
      # @return [IMW::Metadata::Schema]
      def schema= new_schema
        @schema = IMW::Metadata::Schema.new(new_schema)
        validate_schema! if respond_to?(:validate_schema!)
        @schema
      end
    end  
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
imw-0.2.16 lib/imw/metadata/schematized.rb
imw-0.2.15 lib/imw/metadata/schematized.rb
imw-0.2.14 lib/imw/metadata/schematized.rb
imw-0.2.13 lib/imw/metadata/schematized.rb
imw-0.2.12 lib/imw/metadata/schematized.rb
imw-0.2.11 lib/imw/metadata/schematized.rb
imw-0.2.10 lib/imw/metadata/schematized.rb
imw-0.2.9 lib/imw/metadata/schematized.rb
imw-0.2.8 lib/imw/metadata/schematized.rb