Sha256: f3d977644859a0f1c0eb28e3dd2337fcc2a9ef161e83dcd9b203fb9c0feea415

Contents?: true

Size: 628 Bytes

Versions: 8

Compression:

Stored size: 628 Bytes

Contents

require 'rundock'

module Rundock
  class Node
    attr_reader :name
    attr_reader :operations
    attr_reader :backend

    def initialize(name, backend)
      @name = name
      @backend = backend
    end

    def add_operation(ope)
      @operations = [] unless @operations
      @operations << ope
    end

    def run
      Logger.debug("run name: #{@name}")
      if @operations.blank?
        Logger.warn("no operation running: #{@name}")
        return
      end
      @operations.each do |ope|
        Logger.debug("operation type: #{ope.class}")
        ope.run(@backend, ope.attributes)
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rundock-0.2.9 lib/rundock/node.rb
rundock-0.2.8 lib/rundock/node.rb
rundock-0.2.7 lib/rundock/node.rb
rundock-0.2.6 lib/rundock/node.rb
rundock-0.2.5 lib/rundock/node.rb
rundock-0.2.4 lib/rundock/node.rb
rundock-0.2.3 lib/rundock/node.rb
rundock-0.2.2 lib/rundock/node.rb