Class: GovernorLivejournal::Livejournal
- Inherits:
-
Object
- Object
- GovernorLivejournal::Livejournal
- Includes:
- LiveJournal
- Defined in:
- lib/governor_livejournal/livejournal.rb
Instance Method Summary collapse
- #delete ⇒ Object
- #get ⇒ Object
-
#initialize(article_or_entry_id) ⇒ Livejournal
constructor
A new instance of Livejournal.
- #post ⇒ Object
- #put ⇒ Object
Constructor Details
#initialize(article_or_entry_id) ⇒ Livejournal
Returns a new instance of Livejournal.
5 6 7 8 9 10 |
# File 'lib/governor_livejournal/livejournal.rb', line 5 def initialize(article_or_entry_id) @article = article_or_entry_id @user = User.new(GovernorLivejournal.config.username, GovernorLivejournal.config.password) login = Request::Login.new(@user) login.run end |
Instance Method Details
#delete ⇒ Object
31 32 33 34 |
# File 'lib/governor_livejournal/livejournal.rb', line 31 def delete delete_event = Request::EditEvent.new(@user, get, :delete => true) delete_event.run end |
#get ⇒ Object
19 20 21 22 |
# File 'lib/governor_livejournal/livejournal.rb', line 19 def get get_events = Request::GetEvents.new(@user, :itemid => livejournal_id) get_events.run end |
#post ⇒ Object
12 13 14 15 16 17 |
# File 'lib/governor_livejournal/livejournal.rb', line 12 def post entry = populate_entry(Entry.new) post_event = Request::PostEvent.new(@user, entry) post_event.run entry.itemid end |
#put ⇒ Object
24 25 26 27 28 29 |
# File 'lib/governor_livejournal/livejournal.rb', line 24 def put entry = populate_entry(get) edit_event = Request::EditEvent.new(@user, entry) edit_event.run entry.itemid end |