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.13.7 lib/serverspec/type/base.rb
serverspec-0.13.6 lib/serverspec/type/base.rb
serverspec-0.13.5 lib/serverspec/type/base.rb
serverspec-0.13.4 lib/serverspec/type/base.rb
serverspec-0.13.3 lib/serverspec/type/base.rb
serverspec-0.13.2 lib/serverspec/type/base.rb
serverspec-0.13.1 lib/serverspec/type/base.rb
serverspec-0.13.0 lib/serverspec/type/base.rb
serverspec-0.12.0 lib/serverspec/type/base.rb
serverspec-0.11.5 lib/serverspec/type/base.rb
serverspec-0.11.4 lib/serverspec/type/base.rb
serverspec-0.11.3 lib/serverspec/type/base.rb
serverspec-0.11.2 lib/serverspec/type/base.rb
serverspec-0.11.1 lib/serverspec/type/base.rb
serverspec-0.11.0 lib/serverspec/type/base.rb
serverspec-0.10.13 lib/serverspec/type/base.rb
serverspec-0.10.12 lib/serverspec/type/base.rb
serverspec-0.10.11 lib/serverspec/type/base.rb
serverspec-0.10.10 lib/serverspec/type/base.rb
serverspec-0.10.9 lib/serverspec/type/base.rb