Class: NicInfo::ErrorCode

Inherits:
Object
  • Object
show all
Defined in:
lib/nicinfo/error_code.rb

Overview

deals with RDAP error code structures

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ ErrorCode

Returns a new instance of ErrorCode.



27
28
29
30
# File 'lib/nicinfo/error_code.rb', line 27

def initialize( config )
  @config = config
  @common = CommonJson.new( config )
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



25
26
27
# File 'lib/nicinfo/error_code.rb', line 25

def config
  @config
end

Instance Method Details

#display_error_code(ec) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/nicinfo/error_code.rb', line 32

def display_error_code ec
  @config.logger.start_data_item
  title = ec[ "title" ]
  if title == nil
    title = ""
  end
  @config.logger.prose NicInfo::DataAmount::NORMAL_DATA, "[ ERROR ]", title, NicInfo::AttentionType::ERROR
  @config.logger.prose NicInfo::DataAmount::NORMAL_DATA, "Code", ec[ "errorCode" ]
  description = ec[ "description" ]
  i = 1
  description.each do |line|
    @config.logger.prose NicInfo::DataAmount::NORMAL_DATA, i.to_s, line
    i = i + 1
  end
  links = ec[ "links" ]
  @common.display_simple_links( links )
  @config.logger.end_data_item
end