abstract class Ohm::Model

Defined in:

ohm.cr

Constant Summary

LUA = {save: {src: with_file("ohm/save.lua", "cat"), sha: ((with_file("ohm/save.lua", "shasum")).split(' ')).first}, delete: {src: with_file("ohm/delete.lua", "cat"), sha: ((with_file("ohm/delete.lua", "shasum")).split(' ')).first}}

Constructors

Class Method Summary

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(atts : Hash(String, String)) #

[View source]
def self.new #

[View source]

Class Method Detail

def self.[](id : String) #

[View source]
def self.[](id : Int) #

[View source]
def self.[](id : Nil) #

[View source]
def self.all #

[View source]
def self.as_index(name : String, value : String) #

[View source]
def self.as_index(name : String, values : Array(String)) #

[View source]
def self.as_indices(filter : Hash(String, String | Array(String))) #

[View source]
def self.attributes #

[View source]
def self.create(atts) #

[View source]
def self.create #

[View source]
def self.fetch(ids : Array(Resp::Reply)) #

[View source]
def self.find(filter : Hash(String, String | Array(String))) #

[View source]
def self.includes?(id : String) #

[View source]
def self.includes?(id : Int) #

[View source]
def self.indices #

[View source]
def self.key #

[View source]
def self.redis #

[View source]
def self.tracked #

[View source]
def self.uniques #

[View source]
def self.with(name, value) #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def ==(other) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def attributes : Hash(String, String) #

[View source]
def counters #

[View source]
def delete #

[View source]
def id : String | Nil #

[View source]
def key #

[View source]
def merge(atts : Array(Resp::Reply)) #

[View source]
def merge(atts : Hash(String, String)) #

[View source]
def model #

[View source]
def redis #

[View source]
def retrieve! #

[View source]
def save #

[View source]
def update(atts : Hash(String, String)) #

[View source]

Macro Detail

macro attribute(name) #

[View source]
macro collection(name, model, reference) #

[View source]
macro counter(name) #

[View source]
macro index(name) #

[View source]
macro list(name, model) #

[View source]
macro mutable(name, model, type) #

[View source]
macro reference(name, model) #

[View source]
macro set(name, model) #

[View source]
macro track(name) #

[View source]
macro unique(name) #

[View source]
macro with_file(filename, command) #

[View source]