Class: Sanity::Resource

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Attributes, ActiveModel::Model, Mutatable, Publishable, Queryable, Serializable
Defined in:
lib/sanity/resource.rb

Overview

Sanity::Resource is the base class used by the sanity resources defined within this gem.

Out of the box it includes the following mixins:

Sanity::Mutatable
Sanity::Queryable
Sanity::Serializable

Sanity::Document and Sanity::Asset both inherit from Sanity::Resource

Any PORO in your project could become a Sanity::Resource via inheritance

Examples:

inherit from Sanity::Resource

class User < Sanity::Resource
  attribute :first_name, default: ""
  queryable
  mutatable
end

Direct Known Subclasses

Asset, Document

Method Summary

Methods included from Serializable

included

Methods included from Publishable

included

Methods included from Queryable

included

Methods included from Mutatable

included