Exception: WifiWand::BaseModel::OsCommandError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/wifi-wand/models/base_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(exitstatus, command, text) ⇒ OsCommandError

Returns a new instance of OsCommandError.



18
19
20
21
22
# File 'lib/wifi-wand/models/base_model.rb', line 18

def initialize(exitstatus, command, text)
  @exitstatus = exitstatus
  @command = command
  @text = text
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



16
17
18
# File 'lib/wifi-wand/models/base_model.rb', line 16

def command
  @command
end

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



16
17
18
# File 'lib/wifi-wand/models/base_model.rb', line 16

def exitstatus
  @exitstatus
end

#textObject (readonly)

Returns the value of attribute text.



16
17
18
# File 'lib/wifi-wand/models/base_model.rb', line 16

def text
  @text
end

Instance Method Details

#to_hObject



28
29
30
# File 'lib/wifi-wand/models/base_model.rb', line 28

def to_h
  { exitstatus: exitstatus, command: command, text: text }
end

#to_sObject



24
25
26
# File 'lib/wifi-wand/models/base_model.rb', line 24

def to_s
  "#{self.class.name}: Error code #{exitstatus}, command = #{command}, text = #{text}"
end