Sha256: 78d426056ea6d7ad492d98f856cbae1fc5388673c35f3d49b162d9bb25e8cf7a
Contents?: true
Size: 688 Bytes
Versions: 12
Compression:
Stored size: 688 Bytes
Contents
class RestModel class Key module Builder include Relation::Builder include Embeddable::Builder include Property::Builder def key(key) fail "you can't define a key with name '#{key.name}'" if not_allowed?(key) key.model = self attr_accessor key.name self.keys << key self.id_key = key if key.options[:id] end def summarizes(*args) args.each do |name| key = keys.find {|key| key.name == name} summarized_keys << key if key end end private def not_allowed?(key) RestModel.not_allowed_names.include?(key.name.to_s) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems