Class: Readwise::Document
- Inherits:
-
Struct
- Object
- Struct
- Readwise::Document
- Defined in:
- lib/readwise/document.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#category ⇒ Object
Returns the value of attribute category.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#html ⇒ Object
Returns the value of attribute html.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#location ⇒ Object
Returns the value of attribute location.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#published_date ⇒ Object
Returns the value of attribute published_date.
-
#reading_progress ⇒ Object
Returns the value of attribute reading_progress.
-
#site_name ⇒ Object
Returns the value of attribute site_name.
-
#source ⇒ Object
Returns the value of attribute source.
-
#source_url ⇒ Object
Returns the value of attribute source_url.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
-
#word_count ⇒ Object
Returns the value of attribute word_count.
Instance Method Summary collapse
- #article? ⇒ Boolean
- #book? ⇒ Boolean
- #child? ⇒ Boolean
- #created_at_time ⇒ Object
- #email? ⇒ Boolean
- #epub? ⇒ Boolean
- #highlight? ⇒ Boolean
- #in_archive? ⇒ Boolean
- #in_later? ⇒ Boolean
- #in_new? ⇒ Boolean
- #note? ⇒ Boolean
- #parent? ⇒ Boolean
- #pdf? ⇒ Boolean
- #published_date_time ⇒ Object
- #read?(threshold: 0.85) ⇒ Boolean
- #rss? ⇒ Boolean
- #serialize ⇒ Object
- #tweet? ⇒ Boolean
- #updated_at_time ⇒ Object
- #video? ⇒ Boolean
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def @author end |
#category ⇒ Object
Returns the value of attribute category
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def category @category end |
#created_at ⇒ Object
Returns the value of attribute created_at
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def created_at @created_at end |
#html ⇒ Object
Returns the value of attribute html
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def html @html end |
#id ⇒ Object
Returns the value of attribute id
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def id @id end |
#image_url ⇒ Object
Returns the value of attribute image_url
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def image_url @image_url end |
#location ⇒ Object
Returns the value of attribute location
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def location @location end |
#notes ⇒ Object
Returns the value of attribute notes
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def notes @notes end |
#parent_id ⇒ Object
Returns the value of attribute parent_id
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def parent_id @parent_id end |
#published_date ⇒ Object
Returns the value of attribute published_date
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def published_date @published_date end |
#reading_progress ⇒ Object
Returns the value of attribute reading_progress
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def reading_progress @reading_progress end |
#site_name ⇒ Object
Returns the value of attribute site_name
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def site_name @site_name end |
#source ⇒ Object
Returns the value of attribute source
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def source @source end |
#source_url ⇒ Object
Returns the value of attribute source_url
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def source_url @source_url end |
#summary ⇒ Object
Returns the value of attribute summary
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def summary @summary end |
#tags ⇒ Object
Returns the value of attribute tags
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def @tags end |
#title ⇒ Object
Returns the value of attribute title
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def url @url end |
#word_count ⇒ Object
Returns the value of attribute word_count
4 5 6 |
# File 'lib/readwise/document.rb', line 4 def word_count @word_count end |
Instance Method Details
#article? ⇒ Boolean
89 90 91 |
# File 'lib/readwise/document.rb', line 89 def article? category == 'article' end |
#book? ⇒ Boolean
93 94 95 |
# File 'lib/readwise/document.rb', line 93 def book? category == 'book' end |
#child? ⇒ Boolean
57 58 59 |
# File 'lib/readwise/document.rb', line 57 def child? !parent? end |
#created_at_time ⇒ Object
31 32 33 34 35 |
# File 'lib/readwise/document.rb', line 31 def created_at_time return unless created_at Time.parse(created_at) end |
#email? ⇒ Boolean
97 98 99 |
# File 'lib/readwise/document.rb', line 97 def email? category == 'email' end |
#epub? ⇒ Boolean
77 78 79 |
# File 'lib/readwise/document.rb', line 77 def epub? category == 'epub' end |
#highlight? ⇒ Boolean
105 106 107 |
# File 'lib/readwise/document.rb', line 105 def highlight? category == 'highlight' end |
#in_archive? ⇒ Boolean
69 70 71 |
# File 'lib/readwise/document.rb', line 69 def in_archive? location == 'archive' end |
#in_later? ⇒ Boolean
65 66 67 |
# File 'lib/readwise/document.rb', line 65 def in_later? location == 'later' end |
#in_new? ⇒ Boolean
61 62 63 |
# File 'lib/readwise/document.rb', line 61 def in_new? location == 'new' end |
#note? ⇒ Boolean
109 110 111 |
# File 'lib/readwise/document.rb', line 109 def note? category == 'note' end |
#parent? ⇒ Boolean
53 54 55 |
# File 'lib/readwise/document.rb', line 53 def parent? parent_id.nil? end |
#pdf? ⇒ Boolean
73 74 75 |
# File 'lib/readwise/document.rb', line 73 def pdf? category == 'pdf' end |
#published_date_time ⇒ Object
43 44 45 46 47 |
# File 'lib/readwise/document.rb', line 43 def published_date_time return unless published_date Time.at(published_date/1000) end |
#read?(threshold: 0.85) ⇒ Boolean
49 50 51 |
# File 'lib/readwise/document.rb', line 49 def read?(threshold: 0.85) reading_progress >= threshold end |
#rss? ⇒ Boolean
101 102 103 |
# File 'lib/readwise/document.rb', line 101 def rss? category == 'rss' end |
#serialize ⇒ Object
113 114 115 |
# File 'lib/readwise/document.rb', line 113 def serialize to_h end |
#tweet? ⇒ Boolean
81 82 83 |
# File 'lib/readwise/document.rb', line 81 def tweet? category == 'tweet' end |
#updated_at_time ⇒ Object
37 38 39 40 41 |
# File 'lib/readwise/document.rb', line 37 def updated_at_time return unless updated_at Time.parse(updated_at) end |
#video? ⇒ Boolean
85 86 87 |
# File 'lib/readwise/document.rb', line 85 def video? category == 'video' end |