Class: AocCli::Year::Meta

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

Direct Known Subclasses

Progress, Requests::Request

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(u: Prefs.default_alias, y: Metafile.get(:year)) ⇒ Meta

Returns a new instance of Meta.



10
11
12
13
14
15
# File 'lib/aoc_cli/year.rb', line 10

def initialize(u:Prefs.default_alias,
         y:Metafile.get(:year))
  @user  = Validate.user(u)
  @year  = Validate.year(y)
  @paths = Paths::Year.new(u:user, y:year)
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



9
10
11
# File 'lib/aoc_cli/year.rb', line 9

def paths
  @paths
end

#userObject (readonly)

Returns the value of attribute user.



9
10
11
# File 'lib/aoc_cli/year.rb', line 9

def user
  @user
end

#yearObject (readonly)

Returns the value of attribute year.



9
10
11
# File 'lib/aoc_cli/year.rb', line 9

def year
  @year
end

Instance Method Details

#writeObject



16
17
18
19
# File 'lib/aoc_cli/year.rb', line 16

def write
  File.write(paths.local(f:"meta"), 
    Metafile.year(u:user, y:year))
end