Class: AocCli::Day::Requests::Request

Inherits:
Init
  • Object
show all
Defined in:
lib/aoc_cli/day.rb

Direct Known Subclasses

Input, Puzzle

Instance Attribute Summary collapse

Attributes inherited from Init

#day, #paths, #user, #year

Instance Method Summary collapse

Methods inherited from Init

#meta, #mkdir

Constructor Details

#initialize(u: Metafile.get(:user), y: Metafile.get(:year), d: Metafile.get(:day)) ⇒ Request

Returns a new instance of Request.



71
72
73
74
75
76
77
# File 'lib/aoc_cli/day.rb', line 71

def initialize(u:Metafile.get(:user), 
			   y:Metafile.get(:year),
			   d:Metafile.get(:day))
	super(u:u, y:y, d:d)
	@data = parse(raw:fetch)
	@part = Metafile.part(d:day)
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



70
71
72
# File 'lib/aoc_cli/day.rb', line 70

def data
  @data
end

#partObject (readonly)

Returns the value of attribute part.



70
71
72
# File 'lib/aoc_cli/day.rb', line 70

def part
  @part
end

Instance Method Details

#write(to:) ⇒ Object



78
79
80
# File 'lib/aoc_cli/day.rb', line 78

def write(to:)
	to.each{|path| File.write(path, data)}; self
end