Class: LLRemote::Logi
- Inherits:
-
Object
- Object
- LLRemote::Logi
- Defined in:
- lib/l_l_remote/logi.rb
Overview
LLRemote::Logi is a logi that can be read and saved remotely
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#link ⇒ Object
Returns the value of attribute link.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(options) ⇒ Logi
constructor
Initializes a logi.
-
#reload ⇒ Object
Loads the logi with it’s remote data.
-
#save ⇒ Object
Saves the logi.
Constructor Details
#initialize(options) ⇒ Logi
Initializes a logi.
Options:
-
link
= link of the logi (can have different tags for existing logis to update it’s tags) -
title
= the title (optional for existing logi) -
body
= the body (optional for existing logi)
14 15 16 17 18 |
# File 'lib/l_l_remote/logi.rb', line 14 def initialize() self.link = [:link] self.title = [:title] self.body = [:body] end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
4 5 6 |
# File 'lib/l_l_remote/logi.rb', line 4 def body @body end |
#link ⇒ Object
Returns the value of attribute link.
4 5 6 |
# File 'lib/l_l_remote/logi.rb', line 4 def link @link end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/l_l_remote/logi.rb', line 4 def title @title end |
Instance Method Details
#reload ⇒ Object
Loads the logi with it’s remote data
22 23 24 25 |
# File 'lib/l_l_remote/logi.rb', line 22 def reload entry = LLRemote.load_entry(self.link) self.set_from_entry(entry) end |
#save ⇒ Object
Saves the logi. It creates it if it doesn’t exist, and updates it if it does.
30 31 32 33 34 35 36 |
# File 'lib/l_l_remote/logi.rb', line 30 def save if self.link =~ /=/ return self.update else return self.create end end |