Class: ShareNotify::SearchResponse::Document
- Inherits:
-
Object
- Object
- ShareNotify::SearchResponse::Document
- Defined in:
- lib/share_notify/search_response.rb
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
Instance Method Summary collapse
- #canonical_uri ⇒ Object
- #contributors ⇒ Object
- #doc_id ⇒ Object
-
#initialize(doc) ⇒ Document
constructor
A new instance of Document.
- #properties ⇒ Object
- #provider_uris ⇒ Object
- #source ⇒ Object
- #title ⇒ Object
- #updated ⇒ Object
- #uris ⇒ Object
Constructor Details
#initialize(doc) ⇒ Document
Returns a new instance of Document.
24 25 26 |
# File 'lib/share_notify/search_response.rb', line 24 def initialize(doc) @doc = doc end |
Instance Attribute Details
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
22 23 24 |
# File 'lib/share_notify/search_response.rb', line 22 def doc @doc end |
Instance Method Details
#canonical_uri ⇒ Object
60 61 62 63 |
# File 'lib/share_notify/search_response.rb', line 60 def canonical_uri return if uris.nil? uris.fetch('canonicalUri', nil) end |
#contributors ⇒ Object
28 29 30 |
# File 'lib/share_notify/search_response.rb', line 28 def contributors doc.fetch('contributors', []) end |
#doc_id ⇒ Object
40 41 42 43 |
# File 'lib/share_notify/search_response.rb', line 40 def doc_id return if properties.nil? properties.fetch('docID', nil) end |
#properties ⇒ Object
36 37 38 |
# File 'lib/share_notify/search_response.rb', line 36 def properties doc.fetch('shareProperties', nil) end |
#provider_uris ⇒ Object
65 66 67 68 |
# File 'lib/share_notify/search_response.rb', line 65 def provider_uris return if uris.nil? uris.fetch('providerUris', []) end |
#source ⇒ Object
45 46 47 48 |
# File 'lib/share_notify/search_response.rb', line 45 def source return if properties.nil? properties.fetch('source', nil) end |
#title ⇒ Object
32 33 34 |
# File 'lib/share_notify/search_response.rb', line 32 def title doc.fetch('title', nil) end |
#updated ⇒ Object
50 51 52 53 54 |
# File 'lib/share_notify/search_response.rb', line 50 def updated time_string = doc.fetch('providerUpdatedDateTime', nil) return if time_string.nil? Time.parse(time_string) end |
#uris ⇒ Object
56 57 58 |
# File 'lib/share_notify/search_response.rb', line 56 def uris doc.fetch('uris', nil) end |