Sha256: 6491e972d936d9812400aa5eb64a5961f8f80310945d25972e276400f965b767

Contents?: true

Size: 429 Bytes

Versions: 4

Compression:

Stored size: 429 Bytes

Contents

module Serverspec
  module Type
    class Base
      def initialize(name=nil)
        @name   = name
        @runner = Specinfra::Runner
      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

      def to_ary
        to_s.split(" ")
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta19 lib/serverspec/type/base.rb
serverspec-2.0.0.beta18 lib/serverspec/type/base.rb
serverspec-2.0.0.beta17 lib/serverspec/type/base.rb
serverspec-2.0.0.beta16 lib/serverspec/type/base.rb