Class: WikipediaRestClient::Page
- Inherits:
-
Object
- Object
- WikipediaRestClient::Page
- Defined in:
- lib/wikipedia_rest_client/page.rb
Overview
WikipediaRestClient::Page class
Instance Method Summary collapse
-
#api_urls_edit_html ⇒ Object
Returns edit_html url.
-
#api_urls_media ⇒ Object
Returns media url.
-
#api_urls_metadata ⇒ Object
Returns metadata url.
-
#api_urls_references ⇒ Object
Returns references rul.
-
#api_urls_summary ⇒ Object
Returns summary url.
-
#api_urls_talk_page_html ⇒ Object
Returns talk_page_html url.
-
#description ⇒ Object
Returns description of that page content.
-
#dir ⇒ Object
Returns dir.
-
#display_title ⇒ Object
Returns the display title of the Page.
-
#image_height ⇒ Object
Returns height of the main image it the page.
-
#image_url ⇒ Object
Returns the url of the main image in the page.
-
#image_width ⇒ Object
Returns width of the main image it the page.
-
#initialize(json) ⇒ Page
constructor
initialize the data of the Page object.
-
#lang ⇒ Object
Returns the language of that page.
-
#namespace_id ⇒ Object
Returns the namespace id of the page.
-
#namespace_text ⇒ Object
Returns the namespace text.
-
#normalized_title ⇒ Object
Returns normalized title.
-
#pageid ⇒ Object
Returns the pageid of that page.
-
#revision ⇒ Object
Returns revision.
-
#text ⇒ Object
Returns the text of the page.
-
#text_html ⇒ Object
Returns extract_html.
-
#thumbnail_height ⇒ Object
Returns the height of the thumbnail image.
-
#thumbnail_source ⇒ Object
Returns the source of the thumbnail image.
-
#thumbnail_width ⇒ Object
Returns the width of the thumbnail image.
-
#tid ⇒ Object
Returns tid.
-
#timestamp ⇒ Object
Returns timestamp.
-
#title ⇒ Object
Returns the title of the Page.
-
#titles_canonical ⇒ Object
Returns the tile (canonical).
-
#titles_display ⇒ Object
Returns the title (display).
-
#titles_normalized ⇒ Object
Returns the title (normalized).
-
#type ⇒ Object
Returns the type of the Page.
-
#url ⇒ Object
Returns page url (desktop).
-
#url_desktop_edit ⇒ Object
Returns edit url (desktop).
-
#url_desktop_page ⇒ Object
Returns page url (desktop).
-
#url_desktop_revisions ⇒ Object
Returns revision url (desktop).
-
#url_desktop_talk ⇒ Object
Returns talk url (desktop).
-
#url_mobile_edit ⇒ Object
Returns mobile_edit url (mobile).
-
#url_mobile_page ⇒ Object
Returns page url (mobile).
-
#url_mobile_revisions ⇒ Object
Returns revision url (mobile).
-
#url_mobile_talk ⇒ Object
Returns mobile_talk url (mobile).
Constructor Details
#initialize(json) ⇒ Page
initialize the data of the Page object
7 8 9 |
# File 'lib/wikipedia_rest_client/page.rb', line 7 def initialize(json) @data = json end |
Instance Method Details
#api_urls_edit_html ⇒ Object
Returns edit_html url
177 178 179 |
# File 'lib/wikipedia_rest_client/page.rb', line 177 def api_urls_edit_html @data["api_urls"]["edit_html"] end |
#api_urls_media ⇒ Object
Returns media url
172 173 174 |
# File 'lib/wikipedia_rest_client/page.rb', line 172 def api_urls_media @data["api_urls"]["media"] end |
#api_urls_metadata ⇒ Object
Returns metadata url
162 163 164 |
# File 'lib/wikipedia_rest_client/page.rb', line 162 def @data["api_urls"]["metadata"] end |
#api_urls_references ⇒ Object
Returns references rul
167 168 169 |
# File 'lib/wikipedia_rest_client/page.rb', line 167 def api_urls_references @data["api_urls"]["references"] end |
#api_urls_summary ⇒ Object
Returns summary url
157 158 159 |
# File 'lib/wikipedia_rest_client/page.rb', line 157 def api_urls_summary @data["api_urls"]["summary"] end |
#api_urls_talk_page_html ⇒ Object
Returns talk_page_html url
182 183 184 |
# File 'lib/wikipedia_rest_client/page.rb', line 182 def api_urls_talk_page_html @data["api_urls"]["talk_page_html"] end |
#description ⇒ Object
Returns description of that page content
97 98 99 |
# File 'lib/wikipedia_rest_client/page.rb', line 97 def description @data["description"] end |
#dir ⇒ Object
Returns dir
77 78 79 |
# File 'lib/wikipedia_rest_client/page.rb', line 77 def dir @data["dir"] end |
#display_title ⇒ Object
Returns the display title of the Page
22 23 24 |
# File 'lib/wikipedia_rest_client/page.rb', line 22 def display_title @data["displaytitle"] end |
#image_height ⇒ Object
Returns height of the main image it the page
112 113 114 |
# File 'lib/wikipedia_rest_client/page.rb', line 112 def image_height @data["originalimage"]["height"] if @data["originalimage"] end |
#image_url ⇒ Object
Returns the url of the main image in the page
102 103 104 |
# File 'lib/wikipedia_rest_client/page.rb', line 102 def image_url @data["originalimage"]["source"] if @data["originalimage"] end |
#image_width ⇒ Object
Returns width of the main image it the page
107 108 109 |
# File 'lib/wikipedia_rest_client/page.rb', line 107 def image_width @data["originalimage"]["width"] if @data["originalimage"] end |
#lang ⇒ Object
Returns the language of that page
72 73 74 |
# File 'lib/wikipedia_rest_client/page.rb', line 72 def lang @data["lang"] end |
#namespace_id ⇒ Object
Returns the namespace id of the page
27 28 29 |
# File 'lib/wikipedia_rest_client/page.rb', line 27 def namespace_id @data["namespace"]["id"] end |
#namespace_text ⇒ Object
Returns the namespace text
32 33 34 |
# File 'lib/wikipedia_rest_client/page.rb', line 32 def namespace_text @data["namespace"]["text"] end |
#normalized_title ⇒ Object
Returns normalized title
197 198 199 |
# File 'lib/wikipedia_rest_client/page.rb', line 197 def normalized_title @data["normalizedtitle"] end |
#pageid ⇒ Object
Returns the pageid of that page
52 53 54 |
# File 'lib/wikipedia_rest_client/page.rb', line 52 def pageid @data["pageid"] end |
#revision ⇒ Object
Returns revision
82 83 84 |
# File 'lib/wikipedia_rest_client/page.rb', line 82 def revision @data["revision"] end |
#text ⇒ Object
Returns the text of the page
187 188 189 |
# File 'lib/wikipedia_rest_client/page.rb', line 187 def text @data["extract"] end |
#text_html ⇒ Object
Returns extract_html
192 193 194 |
# File 'lib/wikipedia_rest_client/page.rb', line 192 def text_html @data["extract_html"] end |
#thumbnail_height ⇒ Object
Returns the height of the thumbnail image
67 68 69 |
# File 'lib/wikipedia_rest_client/page.rb', line 67 def thumbnail_height @data["thumbnail"]["height"] if @data["thumbnail"] end |
#thumbnail_source ⇒ Object
Returns the source of the thumbnail image
57 58 59 |
# File 'lib/wikipedia_rest_client/page.rb', line 57 def thumbnail_source @data["thumbnail"]["source"] if @data["thumbnail"] end |
#thumbnail_width ⇒ Object
Returns the width of the thumbnail image
62 63 64 |
# File 'lib/wikipedia_rest_client/page.rb', line 62 def thumbnail_width @data["thumbnail"]["width"] if @data["thumbnail"] end |
#tid ⇒ Object
Returns tid
87 88 89 |
# File 'lib/wikipedia_rest_client/page.rb', line 87 def tid @data["tid"] end |
#timestamp ⇒ Object
Returns timestamp
92 93 94 |
# File 'lib/wikipedia_rest_client/page.rb', line 92 def @data["timestamp"] end |
#title ⇒ Object
Returns the title of the Page
17 18 19 |
# File 'lib/wikipedia_rest_client/page.rb', line 17 def title @data["title"] end |
#titles_canonical ⇒ Object
Returns the tile (canonical)
37 38 39 |
# File 'lib/wikipedia_rest_client/page.rb', line 37 def titles_canonical @data["titles"]["canonical"] end |
#titles_display ⇒ Object
Returns the title (display)
47 48 49 |
# File 'lib/wikipedia_rest_client/page.rb', line 47 def titles_display @data["titles"]["display"] end |
#titles_normalized ⇒ Object
Returns the title (normalized)
42 43 44 |
# File 'lib/wikipedia_rest_client/page.rb', line 42 def titles_normalized @data["titles"]["normalized"] end |
#type ⇒ Object
Returns the type of the Page
12 13 14 |
# File 'lib/wikipedia_rest_client/page.rb', line 12 def type @data["type"] end |
#url ⇒ Object
Returns page url (desktop)
202 203 204 |
# File 'lib/wikipedia_rest_client/page.rb', line 202 def url @data["content_urls"]["desktop"]["page"] end |
#url_desktop_edit ⇒ Object
Returns edit url (desktop)
127 128 129 |
# File 'lib/wikipedia_rest_client/page.rb', line 127 def url_desktop_edit @data["content_urls"]["desktop"]["edit"] end |
#url_desktop_page ⇒ Object
Returns page url (desktop)
117 118 119 |
# File 'lib/wikipedia_rest_client/page.rb', line 117 def url_desktop_page @data["content_urls"]["desktop"]["page"] end |
#url_desktop_revisions ⇒ Object
Returns revision url (desktop)
122 123 124 |
# File 'lib/wikipedia_rest_client/page.rb', line 122 def url_desktop_revisions @data["content_urls"]["desktop"]["revision"] end |
#url_desktop_talk ⇒ Object
Returns talk url (desktop)
132 133 134 |
# File 'lib/wikipedia_rest_client/page.rb', line 132 def url_desktop_talk @data["content_urls"]["desktop"]["talk"] end |
#url_mobile_edit ⇒ Object
Returns mobile_edit url (mobile)
147 148 149 |
# File 'lib/wikipedia_rest_client/page.rb', line 147 def url_mobile_edit @data["content_urls"]["mobile"]["edit"] end |
#url_mobile_page ⇒ Object
Returns page url (mobile)
137 138 139 |
# File 'lib/wikipedia_rest_client/page.rb', line 137 def url_mobile_page @data["content_urls"]["mobile"]["page"] end |
#url_mobile_revisions ⇒ Object
Returns revision url (mobile)
142 143 144 |
# File 'lib/wikipedia_rest_client/page.rb', line 142 def url_mobile_revisions @data["content_urls"]["mobile"]["revision"] end |
#url_mobile_talk ⇒ Object
Returns mobile_talk url (mobile)
152 153 154 |
# File 'lib/wikipedia_rest_client/page.rb', line 152 def url_mobile_talk @data["content_urls"]["mobile"]["talk"] end |