Sha256: dab9b65eb43002b89eaddd3b3da330f8b9abb0b3c509ab24bbcda03879234e58

Contents?: true

Size: 680 Bytes

Versions: 1

Compression:

Stored size: 680 Bytes

Contents

require 'axel/configurations/resource'
module Axel
  module Configurations
    class Service
      attr_reader :name
      attr_writer :url
      attr_reader :resources

      delegate :manual_environment_set?,
        :environment,
        to: Axel

      def initialize(name, url)
        @name = name.to_s.singularize
        @resources = {}.with_indifferent_access
        @url = url.to_s
      end

      def url
        manual_environment_set? ? Uri.new(@url).to(*environment).to_s : @url
      end

      def add_resource(resource_name, options = {})
        resources[resource_name] = Configurations::Resource.new(resource_name, self, options)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axel-0.0.1 lib/axel/configurations/service.rb