Class: KindleClippings::Clipping
- Inherits:
-
Object
- Object
- KindleClippings::Clipping
- Defined in:
- lib/kindleclippings/clipping.rb
Constant Summary collapse
- DEFAULT_DATE_FORMAT =
"%A, %B %d, %Y, %I:%M %p"
- KINDLE_TOUCH_DATE_FORMAT =
"%A, %B %d, %Y %I:%M:%S %p"
- ALTERNATIVE_DATE_FORMAT =
"%A, %d %B %y %H:%M:%S %Z"
Instance Attribute Summary collapse
-
#added_on ⇒ Object
Returns the value of attribute added_on.
-
#author ⇒ Object
Returns the value of attribute author.
-
#book_title ⇒ Object
Returns the value of attribute book_title.
-
#content ⇒ Object
Returns the value of attribute content.
-
#location ⇒ Object
Returns the value of attribute location.
-
#page ⇒ Object
Returns the value of attribute page.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(title, author, type, location, added_on, content, page = "0") ⇒ Clipping
constructor
A new instance of Clipping.
- #to_s ⇒ Object
Constructor Details
#initialize(title, author, type, location, added_on, content, page = "0") ⇒ Clipping
Returns a new instance of Clipping.
11 12 |
# File 'lib/kindleclippings/clipping.rb', line 11 def initialize() end |
Instance Attribute Details
#added_on ⇒ Object
Returns the value of attribute added_on.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def added_on @added_on end |
#author ⇒ Object
Returns the value of attribute author.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def @author end |
#book_title ⇒ Object
Returns the value of attribute book_title.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def book_title @book_title end |
#content ⇒ Object
Returns the value of attribute content.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def content @content end |
#location ⇒ Object
Returns the value of attribute location.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def location @location end |
#page ⇒ Object
Returns the value of attribute page.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def page @page end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/kindleclippings/clipping.rb', line 6 def type @type end |
Instance Method Details
#to_s ⇒ Object
34 35 36 37 38 |
# File 'lib/kindleclippings/clipping.rb', line 34 def to_s "#{@book_title} (#{})\n" + "- #{@type} #{('on Page ' + @page.to_s + ' | ') if @page > 0}Loc. #{@location} | Added on #{@added_on.strftime('%A, %B %d, %Y, %I:%M %p')}\n\n" + "#{@content}" end |