Class: DCCSCR::Whitelist::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/dccscr/whitelist.rb

Overview

Internal class to hold a single greylist.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(whitelist:, subpath:, greylist: "#{File.basename(subpath)}.greylist") ⇒ Entry

Returns a new instance of Entry.



44
45
46
47
48
49
50
# File 'lib/dccscr/whitelist.rb', line 44

def initialize(whitelist:, subpath:, greylist: "#{File.basename(subpath)}.greylist")
  warn "Parse: #{File.join subpath,  greylist}"

  @value = JSON.parse(File.read(File.join(whitelist.path, subpath, greylist)))

  whitelist[@parent] unless (@parent = @value['image_parent_name'] || '').empty?
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent.



42
43
44
# File 'lib/dccscr/whitelist.rb', line 42

def parent
  @parent
end

#valueObject (readonly)

Returns the value of attribute value.



42
43
44
# File 'lib/dccscr/whitelist.rb', line 42

def value
  @value
end