Module: LiveJournal::Request

Defined in:
lib/livejournal/sync.rb,
lib/livejournal/entry.rb,
lib/livejournal/login.rb,
lib/livejournal/friends.rb,
lib/livejournal/request.rb

Defined Under Namespace

Classes: CheckFriends, EditEvent, FriendOfs, Friends, GetChallenge, GetEvents, HashStrip, Login, PostEvent, ProtocolException, Req, SessionGenerate, SyncItems

Class Method Summary collapse

Class Method Details

.ljtime_to_time(str) ⇒ Object

Convert an ljtime to a Time.



42
43
44
45
# File 'lib/livejournal/request.rb', line 42

def self.ljtime_to_time str
  dt = DateTime.strptime(str, '%Y-%m-%d %H:%M')
  Time.gm(dt.year, dt.mon, dt.day, dt.hour, dt.min, 0, 0)
end

.time_to_ljtime(time) ⇒ Object

ljtimes look like 2005-12-04 10:24:00. Convert a Time to an ljtime.



38
39
40
# File 'lib/livejournal/request.rb', line 38

def self.time_to_ljtime time
  time.strftime '%Y-%m-%d %H:%M:%S'
end