Class: DCCSCR::Whitelist::Entry
- Inherits:
-
Object
- Object
- DCCSCR::Whitelist::Entry
- Defined in:
- lib/dccscr/whitelist.rb
Overview
Internal class to hold a single greylist.
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(whitelist:, subpath:, greylist: "#{File.basename(subpath)}.greylist") ⇒ Entry
constructor
A new instance of Entry.
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
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
42 43 44 |
# File 'lib/dccscr/whitelist.rb', line 42 def parent @parent end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
42 43 44 |
# File 'lib/dccscr/whitelist.rb', line 42 def value @value end |