Class: Serverspec::Type::Base
- Inherits:
-
Object
- Object
- Serverspec::Type::Base
- Defined in:
- lib/serverspec/type/base.rb
Direct Known Subclasses
Bond, Bridge, Cgroup, Command, Cron, DefaultGateway, DockerBase, File, Fstab, Group, HadoopConfig, Host, IisAppPool, IisWebsite, Interface, Ip6tables, Ipfilter, Ipnat, Iptables, KernelModule, LinuxAuditSystem, LinuxKernelParameter, Lxc, MailAlias, MysqlConfig, Package, PhpConfig, PhpExtension, Port, Ppa, Process, RoutingTable, Selinux, SelinuxModule, Service, User, WindowsFeature, WindowsHotFix, WindowsRegistryKey, WindowsScheduledTask, X509Certificate, X509PrivateKey, Yumrepo, Zfs
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name = nil, options = {}) ⇒ Base
constructor
A new instance of Base.
- #inspect ⇒ Object
- #to_ary ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name = nil, options = {}) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 |
# File 'lib/serverspec/type/base.rb', line 6 def initialize(name=nil, = {}) @name = name @options = @runner = Specinfra::Runner end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/serverspec/type/base.rb', line 4 def name @name end |
Instance Method Details
#inspect ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/serverspec/type/base.rb', line 19 def inspect if defined?(PowerAssert) @inspection else to_s end end |
#to_ary ⇒ Object
27 28 29 |
# File 'lib/serverspec/type/base.rb', line 27 def to_ary to_s.split(" ") end |
#to_s ⇒ Object
12 13 14 15 16 17 |
# File 'lib/serverspec/type/base.rb', line 12 def to_s type = self.class.name.split(':')[-1] type.gsub!(/([a-z\d])([A-Z])/, '\1 \2') type.capitalize! %Q!#{type} "#{@name}"! end |