class Object
Public Instance Methods
input()
click to toggle source
入力部
# File lib/apiday.rb, line 11 def input print 'Please set your birthday!' print 'Set year : ' while year = gets.chomp.to_i if year < 1000 || year > 3000 then puts 'Input error : Please set proper number' print 'Set year : ' else break end end print 'Set month : ' while month = gets.chomp.to_i if month < 1 || month > 12 then puts 'Input error : Please set proper number' print 'Set month : ' else break end end print 'Set day : ' while day = gets.chomp.to_i if day < 1 || day > 31 then puts 'Input error : Please set proper number' print 'Set day : ' else break end end puts "Your birthday is #{year}/#{month}/#{day}" return year, month, day end
output()
click to toggle source
テキスト出力部
# File lib/apiday.rb, line 56 def output end
twitter(year, month ,day)
click to toggle source
twitter呼び出し部
# File lib/apiday.rb, line 51 def twitter(year, month ,day) end
wikipedia(year, month, day)
click to toggle source
wikipedia呼び出し部
# File lib/apiday.rb, line 45 def wikipedia(year, month, day) page_year = Wikipedia.find(year) return page_year.content[1,1000] end