class WikipediaRestClient::Page

WikipediaRestClient::Page class @author Balaji

Public Class Methods

new(json) click to toggle source

initialize the data of the Page object

# File lib/wikipedia_rest_client/page.rb, line 7
def initialize(json)
        @data = json
end

Public Instance Methods

api_urls_edit_html() click to toggle source

Returns edit_html url

# File lib/wikipedia_rest_client/page.rb, line 177
def api_urls_edit_html
        @data["api_urls"]["edit_html"]
end
api_urls_media() click to toggle source

Returns media url

# File lib/wikipedia_rest_client/page.rb, line 172
def api_urls_media
        @data["api_urls"]["media"]
end
api_urls_metadata() click to toggle source

Returns metadata url

# File lib/wikipedia_rest_client/page.rb, line 162
def api_urls_metadata
        @data["api_urls"]["metadata"]
end
api_urls_references() click to toggle source

Returns references rul

# File lib/wikipedia_rest_client/page.rb, line 167
def api_urls_references
        @data["api_urls"]["references"]
end
api_urls_summary() click to toggle source

Returns summary url

# File lib/wikipedia_rest_client/page.rb, line 157
def api_urls_summary
        @data["api_urls"]["summary"]
end
api_urls_talk_page_html() click to toggle source

Returns talk_page_html url

# File lib/wikipedia_rest_client/page.rb, line 182
def api_urls_talk_page_html
        @data["api_urls"]["talk_page_html"]
end
description() click to toggle source

Returns description of that page content

# File lib/wikipedia_rest_client/page.rb, line 97
def description
        @data["description"]
end
dir() click to toggle source

Returns dir

# File lib/wikipedia_rest_client/page.rb, line 77
def dir
        @data["dir"]
end
display_title() click to toggle source

Returns the display title of the Page

# File lib/wikipedia_rest_client/page.rb, line 22
def display_title
        @data["displaytitle"]
end
image_height() click to toggle source

Returns height of the main image it the page

# File lib/wikipedia_rest_client/page.rb, line 112
def image_height
        @data["originalimage"]["height"] if @data["originalimage"]
end
image_url() click to toggle source

Returns the url of the main image in the page

# File lib/wikipedia_rest_client/page.rb, line 102
def image_url
        @data["originalimage"]["source"] if @data["originalimage"]
end
image_width() click to toggle source

Returns width of the main image it the page

# File lib/wikipedia_rest_client/page.rb, line 107
def image_width
        @data["originalimage"]["width"] if @data["originalimage"]
end
lang() click to toggle source

Returns the language of that page

# File lib/wikipedia_rest_client/page.rb, line 72
def lang
        @data["lang"]
end
namespace_id() click to toggle source

Returns the namespace id of the page

# File lib/wikipedia_rest_client/page.rb, line 27
def namespace_id
        @data["namespace"]["id"]
end
namespace_text() click to toggle source

Returns the namespace text

# File lib/wikipedia_rest_client/page.rb, line 32
def namespace_text
        @data["namespace"]["text"]
end
normalized_title() click to toggle source

Returns normalized title

# File lib/wikipedia_rest_client/page.rb, line 197
def normalized_title
        @data["normalizedtitle"]
end
pageid() click to toggle source

Returns the pageid of that page

# File lib/wikipedia_rest_client/page.rb, line 52
def pageid
        @data["pageid"]
end
revision() click to toggle source

Returns revision

# File lib/wikipedia_rest_client/page.rb, line 82
def revision
        @data["revision"]
end
text() click to toggle source

Returns the text of the page

# File lib/wikipedia_rest_client/page.rb, line 187
def text
        @data["extract"]
end
text_html() click to toggle source

Returns extract_html

# File lib/wikipedia_rest_client/page.rb, line 192
def text_html
        @data["extract_html"]
end
thumbnail_height() click to toggle source

Returns the height of the thumbnail image

# File lib/wikipedia_rest_client/page.rb, line 67
def thumbnail_height
        @data["thumbnail"]["height"] if @data["thumbnail"]
end
thumbnail_source() click to toggle source

Returns the source of the thumbnail image

# File lib/wikipedia_rest_client/page.rb, line 57
def thumbnail_source
        @data["thumbnail"]["source"] if @data["thumbnail"]
end
thumbnail_width() click to toggle source

Returns the width of the thumbnail image

# File lib/wikipedia_rest_client/page.rb, line 62
def thumbnail_width
        @data["thumbnail"]["width"] if @data["thumbnail"]
end
tid() click to toggle source

Returns tid

# File lib/wikipedia_rest_client/page.rb, line 87
def tid
        @data["tid"]
end
timestamp() click to toggle source

Returns timestamp

# File lib/wikipedia_rest_client/page.rb, line 92
def timestamp
        @data["timestamp"]
end
title() click to toggle source

Returns the title of the Page

# File lib/wikipedia_rest_client/page.rb, line 17
def title
        @data["title"]
end
titles_canonical() click to toggle source

Returns the tile (canonical)

# File lib/wikipedia_rest_client/page.rb, line 37
def titles_canonical
        @data["titles"]["canonical"]
end
titles_display() click to toggle source

Returns the title (display)

# File lib/wikipedia_rest_client/page.rb, line 47
def titles_display
        @data["titles"]["display"]
end
titles_normalized() click to toggle source

Returns the title (normalized)

# File lib/wikipedia_rest_client/page.rb, line 42
def titles_normalized
        @data["titles"]["normalized"]
end
type() click to toggle source

Returns the type of the Page

# File lib/wikipedia_rest_client/page.rb, line 12
def type
        @data["type"]
end
url() click to toggle source

Returns page url (desktop)

# File lib/wikipedia_rest_client/page.rb, line 202
def url
        @data["content_urls"]["desktop"]["page"]
end
url_desktop_edit() click to toggle source

Returns edit url (desktop)

# File lib/wikipedia_rest_client/page.rb, line 127
def url_desktop_edit
        @data["content_urls"]["desktop"]["edit"]
end
url_desktop_page() click to toggle source

Returns page url (desktop)

# File lib/wikipedia_rest_client/page.rb, line 117
def url_desktop_page
        @data["content_urls"]["desktop"]["page"]
end
url_desktop_revisions() click to toggle source

Returns revision url (desktop)

# File lib/wikipedia_rest_client/page.rb, line 122
def url_desktop_revisions
        @data["content_urls"]["desktop"]["revision"]
end
url_desktop_talk() click to toggle source

Returns talk url (desktop)

# File lib/wikipedia_rest_client/page.rb, line 132
def url_desktop_talk
        @data["content_urls"]["desktop"]["talk"]
end
url_mobile_edit() click to toggle source

Returns mobile_edit url (mobile)

# File lib/wikipedia_rest_client/page.rb, line 147
def url_mobile_edit
        @data["content_urls"]["mobile"]["edit"]
end
url_mobile_page() click to toggle source

Returns page url (mobile)

# File lib/wikipedia_rest_client/page.rb, line 137
def url_mobile_page
        @data["content_urls"]["mobile"]["page"]
end
url_mobile_revisions() click to toggle source

Returns revision url (mobile)

# File lib/wikipedia_rest_client/page.rb, line 142
def url_mobile_revisions
        @data["content_urls"]["mobile"]["revision"]
end
url_mobile_talk() click to toggle source

Returns mobile_talk url (mobile)

# File lib/wikipedia_rest_client/page.rb, line 152
def url_mobile_talk
        @data["content_urls"]["mobile"]["talk"]
end