Sha256: c5101b87cba0f3027a5d0f94ac0d82e5c60f21b36948c993f50cd420f4d38b90

Contents?: true

Size: 601 Bytes

Versions: 7

Compression:

Stored size: 601 Bytes

Contents

# frozen_string_literal: true
module ActiveTriples
  ##
  # Super class which provides a simple property DSL for defining property ->
  # predicate mappings.
  class Schema
    class << self
      # @param [Symbol] property The property name on the object.
      # @param [Hash] options Options for the property.
      # @option options [RDF::URI] :predicate The predicate to map the property
      #   to.
      def property(property, options)
        properties << Property.new(options.merge(:name => property))
      end

      def properties
        @properties ||= []
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active-triples-0.11.0 lib/active_triples/schema.rb
active-triples-0.10.2 lib/active_triples/schema.rb
active-triples-0.10.1 lib/active_triples/schema.rb
active-triples-0.10.0 lib/active_triples/schema.rb
active-triples-0.9.0 lib/active_triples/schema.rb
active-triples-0.8.3 lib/active_triples/schema.rb
active-triples-0.8.2 lib/active_triples/schema.rb