class Datahen::CLI::GlobalPage

Public Instance Methods

content(gid) click to toggle source
# File lib/datahen/cli/global_page.rb, line 12
def content(gid)
  client = Client::GlobalPage.new(options)
  result = JSON.parse(client.find_content(gid).to_s)

  if result['available'] == true
    puts "Preview content url: \"#{result['preview_url']}\""
    begin
      `open "#{result['preview_url']}"`
    rescue
    end
  else
    puts "Content does not exist"
  end
end
show(gid) click to toggle source
# File lib/datahen/cli/global_page.rb, line 6
def show(gid)
  client = Client::GlobalPage.new(options)
  puts "#{client.find(gid)}"
end