Sha256: db332465001b11d485c4a44e53b047761b7a6db7e0a0c1f48da774cfa2d0628f

Contents?: true

Size: 339 Bytes

Versions: 42

Compression:

Stored size: 339 Bytes

Contents

module Serverspec
  module Type
    class Base
      def initialize(name=nil)
        @name = name
      end

      def to_s
        type = self.class.name.split(':')[-1]
        type.gsub!(/([a-z\d])([A-Z])/, '\1 \2')
        type.capitalize!
        %Q!#{type} "#{@name}"!
      end

      alias_method :inspect, :to_s
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
serverspec-0.10.8 lib/serverspec/type/base.rb
serverspec-0.10.7 lib/serverspec/type/base.rb
serverspec-0.10.6 lib/serverspec/type/base.rb
serverspec-0.10.5 lib/serverspec/type/base.rb
serverspec-0.10.4 lib/serverspec/type/base.rb
serverspec-0.10.3 lib/serverspec/type/base.rb
serverspec-0.10.2 lib/serverspec/type/base.rb
serverspec-0.10.1 lib/serverspec/type/base.rb
serverspec-0.10.0 lib/serverspec/type/base.rb
serverspec-0.9.8 lib/serverspec/type/base.rb
serverspec-0.9.7 lib/serverspec/type/base.rb
serverspec-0.9.6 lib/serverspec/type/base.rb
serverspec-0.9.5 lib/serverspec/type/base.rb
serverspec-0.9.4 lib/serverspec/type/base.rb
serverspec-0.9.3 lib/serverspec/type/base.rb
serverspec-0.9.2 lib/serverspec/type/base.rb
serverspec-0.9.1 lib/serverspec/type/base.rb
serverspec-0.9.0 lib/serverspec/type/base.rb
serverspec-0.8.1 lib/serverspec/type/base.rb
serverspec-0.8.0 lib/serverspec/type/base.rb