class Trendious::Entry
Attributes
entry[R]
Public Class Methods
new(hash)
click to toggle source
# File lib/trendious/entry.rb, line 7 def initialize hash @entry = hash @entry.keys.each do |k| self.class.instance_eval do define_method(k) do @entry[k] end end end end
Public Instance Methods
link()
click to toggle source
# File lib/trendious/entry.rb, line 19 def link URI.join "http://moviepilot.com", type_path, id.to_s end
read()
click to toggle source
# File lib/trendious/entry.rb, line 27 def read uri = URI.join "http://api.moviepilot.com", "/v4/", type_path, id.to_s JSON.parse(Net::HTTP.get(uri)) end
type_path()
click to toggle source
# File lib/trendious/entry.rb, line 23 def type_path "#{type.pluralize}/" end