Class: AocCli::Commands::CalendarTable

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ CalendarTable

Returns a new instance of CalendarTable.



187
188
189
190
191
# File 'lib/aoc_cli/commands.rb', line 187

def initialize(args)
	args = defaults.merge(args).compact
	@user = Validate.user(args[:user])
	@year = Validate.year(args[:year])
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



186
187
188
# File 'lib/aoc_cli/commands.rb', line 186

def user
  @user
end

#yearObject (readonly)

Returns the value of attribute year.



186
187
188
# File 'lib/aoc_cli/commands.rb', line 186

def year
  @year
end

Instance Method Details

#defaultsObject



195
196
197
198
# File 'lib/aoc_cli/commands.rb', line 195

def defaults
	{ user:Metafile.get(:user),
	  year:Metafile.get(:year) }
end

#execObject



192
193
194
# File 'lib/aoc_cli/commands.rb', line 192

def exec
	Tables::Calendar.new(u:user, y:year).print
end