require 'lib/rme2day' module Me2DAY class Expo attr_accessor :id attr_accessor :api_key def initialize(id = nil, api_key = nil) @id = id @api_key = api_key Rme2day::API.setup(@id, @api_key, '828e442ceea1ecdbc7db09d644ae69e9') end def get_posts puts "글을 가져와야 해요." end def write_post puts "글을 작성해야 해요." end def get_friends puts "친구 목록을 가져와야 해요." end def usage 8.times { print "=" } puts "\n1. 최근글 가져오기" puts "2. 글 작성" puts "3. 친구 보기" puts "4. 그만 하기" 8.times { print "=" } print "\n>> " end def start usage while line = gets case line.to_i when 1 get_posts when 2 write_post when 3 get_friends when 4 break end usage end end end end print "me2day id: " id = gets.strip print "me2day api_key: " api_key = gets.strip console = Me2DAY::Expo.new(id,api_key) console.start