Sha256: 3677ef830fd952d3bff91a84384b35cd073a82c1e5e825b39826a9f9dd914581

Contents?: true

Size: 967 Bytes

Versions: 33

Compression:

Stored size: 967 Bytes

Contents

module Ridley
  class NodeResource < Ridley::Resource
    include Ridley::Logging

    set_resource_path "nodes"
    represented_by Ridley::NodeObject

    # @param [Celluloid::Registry] connection_registry
    def initialize(connection_registry, options = {})
      super(connection_registry)
    end

    # Merges the given data with the the data of the target node on the remote
    #
    # @param [Ridley::NodeResource, String] target
    #   node or identifier of the node to merge
    #
    # @option options [Array] :run_list
    #   run list items to merge
    # @option options [Hash] :attributes
    #   attributes of normal precedence to merge
    #
    # @raise [Errors::ResourceNotFound]
    #   if the target node is not found
    #
    # @return [Ridley::NodeObject]
    def merge_data(target, options = {})
      unless node = find(target)
        abort Errors::ResourceNotFound.new
      end

      update(node.merge_data(options))
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
ridley-5.1.1 lib/ridley/resources/node_resource.rb
ridley-5.1.0 lib/ridley/resources/node_resource.rb
ridley-5.0.0 lib/ridley/resources/node_resource.rb
ridley-4.6.1 lib/ridley/resources/node_resource.rb
ridley-4.6.0 lib/ridley/resources/node_resource.rb
ridley-4.5.1 lib/ridley/resources/node_resource.rb
ridley-4.5.0 lib/ridley/resources/node_resource.rb
ridley-4.4.3 lib/ridley/resources/node_resource.rb
ridley-4.4.2 lib/ridley/resources/node_resource.rb
ridley-4.4.1 lib/ridley/resources/node_resource.rb
ridley-4.4.0 lib/ridley/resources/node_resource.rb
ridley-4.3.2 lib/ridley/resources/node_resource.rb
ridley-4.3.1 lib/ridley/resources/node_resource.rb
ridley-4.3.0 lib/ridley/resources/node_resource.rb
ridley-4.2.0 lib/ridley/resources/node_resource.rb
ridley-4.1.2 lib/ridley/resources/node_resource.rb
ridley-4.1.1 lib/ridley/resources/node_resource.rb
ridley-4.1.0 lib/ridley/resources/node_resource.rb
ridley-4.0.0 lib/ridley/resources/node_resource.rb
ridley-3.1.0 lib/ridley/resources/node_resource.rb