Sha256: 294271113ef4f18fb0458a4d90721fa4e47120d7aa4382a70e4617e37d877921
Contents?: true
Size: 513 Bytes
Versions: 5
Compression:
Stored size: 513 Bytes
Contents
module ButterCMS class Content attr_reader :data def initialize(json) @json = json @data = HashToObject.convert(json["data"]) end def inspect id_string = (self.respond_to?(:id) && !self.id.nil?) ? " id=#{self.id}" : "" "#<#{self.class}:0x#{self.object_id.to_s(16)}#{id_string}> JSON: " + JSON.pretty_generate(@json) end def self.fetch(keys = []) response = ButterCMS.request("/content", {keys: keys.join(',')}) self.new(response) end end end
Version data entries
5 entries across 5 versions & 1 rubygems