class WikipediaRestClient::ImageOfTheDay

@author Balaji

Public Class Methods

new(json) click to toggle source

Returns

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 8
def initialize(json)
        @data = json["image"]
end

Public Instance Methods

description_text() click to toggle source

Returns description about the image

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 48
def description_text
        if @data["description"] 
                html_data = @data["description"]["text"] 
                parsed_data = Nokogiri::HTML(html_data)
                parsed_data.text
        end
end
image_height() click to toggle source

Returns height of the image

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 28
def image_height
        @data["image"]["height"]
end
image_url() click to toggle source

Returns the URL of the image

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 18
def image_url
        @data["image"]["source"]
end
image_width() click to toggle source

Returns width of the image

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 23
def image_width
        @data["image"]["width"]
end
thumbnail() click to toggle source

Returns the source of the thumbnail image

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 33
def thumbnail
        @data["thumbnail"]["source"]
end
thumbnail_height() click to toggle source

Returns height of thumbnail

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 43
def thumbnail_height
        @data["thumbnail"]["height"]
end
thumbnail_width() click to toggle source

Returns width of thumbnail

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 38
def thumbnail_width
        @data["thumbnail"]["width"]
end
title() click to toggle source

Returns the tile of ImageOfTheDay

# File lib/wikipedia_rest_client/image_of_the_day.rb, line 13
def title
        @data["title"]
end