class UtopianRuby::UtopianRubyHelper

Public Class Methods

get_post_repository(author,permlink) click to toggle source

get post github repository

# File lib/utopian_ruby_helper.rb, line 38
def self.get_post_repository(author,permlink)
  p = UtopianRuby::UtopianRubyAPI.get_post(author,permlink)
  p["json_metadata"]["repository"]["html_url"]
end
get_posts_by_type(type,params) click to toggle source

get posts by type

# File lib/utopian_ruby_helper.rb, line 6
def self.get_posts_by_type(type,params)
  if params.nil?
     params = {"limit":1}
  end
  params["type"]=type
  UtopianRuby::UtopianRubyAPI.get_posts(params)
end
get_posts_obj_by_moderator(moderator,params) click to toggle source

get posts by moderator

# File lib/utopian_ruby_helper.rb, line 24
def self.get_posts_obj_by_moderator(moderator,params)
  if params.nil?
     params = {"limit":1}
  end
  posts = Set.new
  UtopianRuby::UtopianRubyAPI.get_posts(params)["results"].each do |p|
    if p["moderator"]==moderator
      posts << UtopianRuby::UtopianRubyAPI.j_to_p(p)
    end
  end
  posts
end
get_posts_obj_by_type(type,params) click to toggle source

get posts object by type

# File lib/utopian_ruby_helper.rb, line 15
def self.get_posts_obj_by_type(type,params)
  if params.nil?
     params = {"limit":1}
  end
  params["type"]=type
  UtopianRuby::UtopianRubyAPI.get_posts_obj(params)
end