Class: Inspec::Resources::Lines

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/resources/mysql_session.rb,
lib/inspec/resources/ibmdb2_session.rb,
lib/inspec/resources/mongodb_session.rb,
lib/inspec/resources/postgres_session.rb,
lib/inspec/resources/cassandradb_session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw, desc, exit_status) ⇒ Lines

Returns a new instance of Lines.



10
11
12
13
14
15
16
17
# File 'lib/inspec/resources/mysql_session.rb', line 10

def initialize(raw, desc, exit_status)
  @output = raw
  @desc = desc
  @exit_status = exit_status
  # backwards compatibility
  @stdout = raw
  @stderr = raw
end

Instance Attribute Details

#exit_statusObject (readonly)

Returns the value of attribute exit_status.



8
9
10
# File 'lib/inspec/resources/mysql_session.rb', line 8

def exit_status
  @exit_status
end

#outputObject (readonly)

Returns the value of attribute output.



8
9
10
# File 'lib/inspec/resources/mysql_session.rb', line 8

def output
  @output
end

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'lib/inspec/resources/mongodb_session.rb', line 5

def params
  @params
end

#stderrObject (readonly)

Returns the value of attribute stderr.



8
9
10
# File 'lib/inspec/resources/mysql_session.rb', line 8

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



8
9
10
# File 'lib/inspec/resources/mysql_session.rb', line 8

def stdout
  @stdout
end

Instance Method Details

#linesObject



19
20
21
# File 'lib/inspec/resources/mysql_session.rb', line 19

def lines
  output.split("\n")
end

#to_sObject



23
24
25
# File 'lib/inspec/resources/mysql_session.rb', line 23

def to_s
  @desc
end