Class: SolarTerms24::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/solar_terms_24/cli.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#list(year) ⇒ Object



11
12
13
14
15
16
# File 'lib/solar_terms_24/cli.rb', line 11

def list(year)
  solar_terms = SolarTerms.new(year.to_i, timezone: options[:timezone], lang: options[:lang])
  solar_terms.solar_terms.each_value do |solar_term|
    puts "#{solar_term.name}: #{solar_term.datetime.strftime("%Y-%m-%d %H:%M")}"
  end
end