class RethinkORM::Lock
- RethinkORM::Lock
- RethinkORM::Base
- ActiveModel::Model
- Reference
- Object
Overview
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
Extended Modules
Direct Known Subclasses
Defined in:
rethinkdb-orm/lock.crConstant Summary
-
CALLBACKS =
{before_save: [] of Nil, after_save: [] of Nil, before_create: [] of Nil, after_create: [] of Nil, before_update: [] of Nil, after_update: [] of Nil, before_destroy: [] of Nil, after_destroy: [] of Nil}
-
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
Constructors
-
.from_trusted_json(string_or_io : String | IO) : self
Serialize from a trusted JSON source
-
.from_trusted_yaml(string_or_io : String | IO) : self
Serialize from a trusted YAML source
-
.new(key : String, expire : Time::Span | Nil = nil, timeout : Time::Span | Nil = nil, instance_token : String = Lock.new_instance_token)
Reset instance token if it's loaded and expired?
-
.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
.new(id : String | Nil | Nil = nil, key : String | Nil = nil, instance_token : String | Nil = nil, expires_at : Time | Nil = nil)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
.new(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Accept HTTP params
Class Method Summary
-
.attributes
You may want a list of available attributes
-
.expired
Returns all expired locks
-
.find(key)
Hash a key
-
.table_name
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
Instance Method Summary
-
#after_create
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#after_destroy
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#after_save
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#after_update
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#apply_defaults
Generate code to apply default values
-
#assign_attributes(id : String | Nil | Missing = Missing, key : String | Missing = Missing, instance_token : String | Missing = Missing, expires_at : Time | Missing = Missing)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String))
Accept HTTP params
-
#assign_attributes_from_json(json)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#assign_attributes_from_trusted_json(json)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#assign_attributes_from_trusted_yaml(yaml)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#assign_attributes_from_yaml(yaml)
Uses the YAML parser as JSON is valid YAML
-
#attributes
Returns a Hash of all the attribute values
-
#attributes_tuple
Returns a NamedTuple of all attribute values
-
#before_create
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#before_destroy
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#before_save
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#before_update
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#changed?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#changed_attributes
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#changed_json
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#changed_yaml
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#clear_changes_information
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#expire : Time::Span
Seconds before the lock expires
-
#expire=(expire : Time::Span)
Seconds before the lock expires
-
#expires_at
expires_at getter
-
#expires_at=(value : Time)
expires_at setter
-
#expires_at_change
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#expires_at_changed?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#expires_at_default : Time
Attribute default value
-
#expires_at_was : Time?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#expires_at_will_change!
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#id : String?
id getter
-
#id=(value : String | Nil)
Override the map json id setter
-
#id_change
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#id_changed?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#id_default : String | Nil
Attribute default value
-
#id_was : String?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#id_will_change!
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#instance_token
instance_token getter
-
#instance_token=(value : String)
instance_token setter
-
#instance_token_change
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#instance_token_changed?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#instance_token_default : String
Attribute default value
-
#instance_token_was : String?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#instance_token_will_change!
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#key
key getter
-
#key=(value : String)
key setter
-
#key_change
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#key_changed?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#key_default : String
Attribute default value
-
#key_was : String?
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#key_will_change!
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
- #lock(expire : Time::Span = self.expire, timeout : Time::Span = self.timeout)
- #locked? : Bool
-
#persistent_attributes
Returns a hash of all attributes that may be persisted
- #refresh(expire : Time::Span | Nil = nil)
-
#restore_attributes
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#run_create_callbacks(&)
Wrap a block with callbacks for the appropriate crud operation
-
#run_destroy_callbacks(&)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#run_save_callbacks(&)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#run_update_callbacks(&)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
- #synchronize(**options, &)
-
#table_name
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#timeout : Time::Span
Lock acquisition timeout
-
#timeout=(timeout : Time::Span)
Lock acquisition timeout
-
#to_json(json : JSON::Builder)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
-
#to_yaml(__temp_96 : YAML::Nodes::Builder)
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
- #try_lock(expire : Time::Span = self.expire)
- #unlock
-
#validate_nilability
DB locks for RethinkDB TODO: Conform to the NoBrainer locking interface.
Instance methods inherited from class RethinkORM::Base
==(other : self)
==,
apply_defaults
apply_defaults,
assign_attributes(id : String | Nil | Missing = Missing)assign_attributes(params : HTTP::Params | Hash(String, String) | Tuple(String, String)) assign_attributes, attributes attributes, attributes_tuple attributes_tuple, id_default : String | Nil id_default, persistent_attributes persistent_attributes, uuid_generator=(generator : Class) uuid_generator=
Class methods inherited from class RethinkORM::Base
all(**options)
all,
attributes
attributes,
changes(id : String | Nil = nil, **options)changes(**options, & : RethinkDB::Table -> HasChanges) changes, clear clear, collection_query(**options, &) collection_query, count
count(**attrs)
count(**attrs, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm) count, create(**attributes) create, create!(**attributes) create!, exists?(id : String, **options) exists?, find(id : String, **options) find, find!(id : String, **options) find!, find_all(ids : Array | Tuple, **options) find_all, find_by(**attribute)
find_by(**attribute, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm) find_by, get_all(values : Array | Tuple, **options) get_all, has_index?(field) has_index?, raw_changes(id : String | Nil = nil, **options)
raw_changes(**options, & : RethinkDB::Table -> HasChanges) raw_changes, raw_query(**options, &) raw_query, table_query(**options, &) table_query, where(&predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
where(**attrs, &predicate : RethinkDB::DatumTerm -> RethinkDB::DatumTerm)
where(attrs : Hash, **options)
where(**attrs) where
Instance methods inherited from module RethinkORM::Persistence
delete
delete,
destroy
destroy,
destroyed
destroyed,
destroyed=(destroyed)
destroyed=,
destroyed?
destroyed?,
new_record?
new_record?,
persisted?
persisted?,
reload!
reload!,
save(**options)
save,
save!(**options)
save!,
update(**attributes)
update,
update!(**attributes)
update!,
update_fields(**attributes)
update_fields
Instance methods inherited from module RethinkORM::Associations
reset_associations
reset_associations
Constructor Detail
Serialize from a trusted JSON source
Serialize from a trusted YAML source
Reset instance token if it's loaded and expired?
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
Accept HTTP params
Class Method Detail
Instance Method Detail
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
Accept HTTP params
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.
DB locks for RethinkDB
TODO Conform to the NoBrainer locking interface.