Sha256: a3fa683fe9f0b98ab775eea71a38a9a64ec7cb4129c1e719fa9cfa87d92ed2a8
Contents?: true
Size: 566 Bytes
Versions: 4
Compression:
Stored size: 566 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 = [], options = {}) params = {keys: keys.join(',')}.merge(options) response = ButterCMS.request("/content/", params) self.new(response) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
buttercms-ruby-1.4 | lib/buttercms/content.rb |
buttercms-ruby-1.3.2 | lib/buttercms/content.rb |
buttercms-ruby-1.3.1 | lib/buttercms/content.rb |
buttercms-ruby-1.3.0 | lib/buttercms/content.rb |