Module: Inspec::Backend::Base

Defined in:
lib/inspec/backend.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#profileObject

Returns the value of attribute profile.



12
13
14
# File 'lib/inspec/backend.rb', line 12

def profile
  @profile
end

Instance Method Details

#inspectObject

Ruby internal for pretty-printing a summary for this class



36
37
38
# File 'lib/inspec/backend.rb', line 36

def inspect
  "Inspec::Backend::Class @transport=#{backend.class}"
end

#local_transport?Boolean

Determine whether the connection/transport is a local connection Useful for resources to modify behavior as necessary, such as using the Ruby stdlib for a better experience.

Returns:

  • (Boolean)


24
25
26
27
28
# File 'lib/inspec/backend.rb', line 24

def local_transport?
  return false unless defined?(Train::Transports::Local)

  backend.is_a?(Train::Transports::Local::Connection)
end

#to_sObject

Ruby internal for printing a nice name for this class



31
32
33
# File 'lib/inspec/backend.rb', line 31

def to_s
  "Inspec::Backend::Class"
end

#versionString

Provide a shorthand to retrieve the inspec version from within a profile

Returns:

  • (String)

    inspec version



17
18
19
# File 'lib/inspec/backend.rb', line 17

def version
  Inspec::VERSION
end