Class: AocCli::Day::Requests::Request
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#part ⇒ Object
readonly
Returns the value of attribute part.
Attributes inherited from Init
Instance Method Summary collapse
-
#initialize(u: Metafile.get(:user), y: Metafile.get(:year), d: Metafile.get(:day)) ⇒ Request
constructor
A new instance of Request.
- #write(to:) ⇒ Object
Methods inherited from Init
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
70 71 72 |
# File 'lib/aoc_cli/day.rb', line 70 def data @data end |
#part ⇒ Object (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 |