Class: Derelict::Parser

Inherits:
Object
  • Object
show all
Includes:
Utils::Logger
Defined in:
lib/derelict/parser.rb,
lib/derelict/parser/status/invalid_format.rb,
lib/derelict/parser/version/invalid_format.rb,
lib/derelict/parser/box_list/invalid_format.rb,
lib/derelict/parser/plugin_list/invalid_format.rb,
lib/derelict/parser/plugin_list/needs_reinstall.rb

Overview

Base class for parsers, which extract data from command output

Direct Known Subclasses

BoxList, PluginList, Status, Version

Defined Under Namespace

Classes: BoxList, PluginList, Status, Version

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Logger

#logger

Constructor Details

#initialize(output) ⇒ Parser

Initializes the parser with the output it will be parsing



15
16
17
18
# File 'lib/derelict/parser.rb', line 15

def initialize(output)
  @output = output
  logger.debug "Successfully initialized #{description}"
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



12
13
14
# File 'lib/derelict/parser.rb', line 12

def output
  @output
end

Instance Method Details

#descriptionObject

Provides a description of this Parser

Mainly used for log messages.



23
24
25
# File 'lib/derelict/parser.rb', line 23

def description
  "Derelict::Parser (unknown type)"
end