class RogueOne::DomainList
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/rogue_one/domain_list.rb, line 9 def initialize(path) @path = path.to_s end
Public Instance Methods
domains()
click to toggle source
# File lib/rogue_one/domain_list.rb, line 17 def domains @domains ||= exists? ? YAML.safe_load(File.read(path)) : nil end
exists?()
click to toggle source
# File lib/rogue_one/domain_list.rb, line 21 def exists? File.exist?(path) end
valid?()
click to toggle source
# File lib/rogue_one/domain_list.rb, line 13 def valid? exists? && valid_format? end
valid_format?()
click to toggle source
# File lib/rogue_one/domain_list.rb, line 25 def valid_format? domains.is_a? Array end