class Contentstack::ContentType
Public Class Methods
all()
click to toggle source
# File lib/contentstack/content_type.rb, line 40 def self.all content_types = API.fetch_content_types["content_types"] content_types.map do |content_type| ContentType.new(content_type.inject({}){|clone,(k,v)| clone[k.to_sym] = v; clone}) end end
new(object)
click to toggle source
# File lib/contentstack/content_type.rb, line 27 def initialize(object) @attributes = object.symbolize_keys end
Public Instance Methods
entry(entry_uid)
click to toggle source
# File lib/contentstack/content_type.rb, line 35 def entry(entry_uid) Entry.new({uid: entry_uid}, self.uid) end
fetch()
click to toggle source
# File lib/contentstack/content_type.rb, line 47 def fetch content_type = API.fetch_content_types(uid)["content_type"] ContentType.new(content_type.inject({}){|clone,(k,v)| clone[k.to_sym] = v; clone}) end
query()
click to toggle source
# File lib/contentstack/content_type.rb, line 31 def query Query.new(self.uid) end