Sha256: 54aa20263921e746d5b6650bd484a71a469eaf7fcb7f91c2590a76dc1bd83209

Contents?: true

Size: 874 Bytes

Versions: 2

Compression:

Stored size: 874 Bytes

Contents

module Ironfan
  class Dsl

    class Facet < Ironfan::Dsl::Compute
      magic      :instances,    Integer,                :default => 1
      collection :servers,      Ironfan::Dsl::Server,   :resolver => :deep_resolve
      field      :cluster_name, String

      def initialize(attrs={},&block)
        self.cluster_names      attrs[:owner].cluster_names unless attrs[:owner].nil?
        self.realm_name         attrs[:owner].realm_name unless attrs[:owner].nil?
        self.cluster_name       = attrs[:owner].cluster_name unless attrs[:owner].nil?
        self.name               = attrs[:name] unless attrs[:name].nil?
        self.facet_role         Ironfan::Dsl::Role.new(:name => "#{full_name}-facet")
        super
        for i in 0 .. instances-1; server(i); end
      end

      def full_name()           "#{cluster_name}-#{name}";      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ironfan-4.12.3 lib/ironfan/dsl/facet.rb
ironfan-4.12.2 lib/ironfan/dsl/facet.rb