Sha256: 4d6d05d941a88cdb738339938209c155024bd1cbea60968308968c6c76b51c09

Contents?: true

Size: 545 Bytes

Versions: 8

Compression:

Stored size: 545 Bytes

Contents

module ActiveTriples
  ##
  # Default property applying strategy which just copies all configured properties
  # from a data property to a new resource, assuming it supports the #property
  # interface.
  class ExtensionStrategy
    class << self
      # @param [ActiveTriples::Resource, #property] resource A resource to copy
      #   the property to.
      # @param [ActiveTriples::Property] property The property to copy.
      def apply(resource, property)
        resource.property property.name, property.to_h
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
active-triples-0.7.6 lib/active_triples/extension_strategy.rb
active-triples-0.7.5 lib/active_triples/extension_strategy.rb
active-triples-0.7.4 lib/active_triples/extension_strategy.rb
active-triples-0.7.3 lib/active_triples/extension_strategy.rb
active-triples-0.7.2 lib/active_triples/extension_strategy.rb
active-triples-0.7.1 lib/active_triples/extension_strategy.rb
active-triples-0.8.1 lib/active_triples/extension_strategy.rb
active-triples-0.8.0 lib/active_triples/extension_strategy.rb