Sha256: 9593277c8d1dee9ab3d6ff3808ca5064ba11f470d0504d302b6b26c421b28199
Contents?: true
Size: 593 Bytes
Versions: 14
Compression:
Stored size: 593 Bytes
Contents
class Editmode::Chunk def initialize end class << self def retrieve(project_id = Editmode.project_id, options = {}) begin root_url = Editmode.api_root_url chunk_id = options[:identifier] || options[:content_key] url = "#{root_url}/chunks/#{chunk_id}?project_id=#{project_id}" response = HTTParty.get(url) if chunk_id.present? return response else chunks = response.try(:[], "chunks") chunks ||= [] end rescue => er Rails.logger.info er [] end end end end
Version data entries
14 entries across 14 versions & 1 rubygems