Class: Moon::DataModel::Base

Inherits:
Metal
  • Object
show all
Defined in:
lib/data_model/base.rb

Overview

Based loosely off the RPG Maker RPG::BaseItem class, provides some basic fields for you to get started.

Direct Known Subclasses

Validators::Type

Instance Attribute Summary collapse

Attributes inherited from Metal

#dmid

Method Summary

Methods inherited from Metal

#initialize, #post_initialize, #pre_initialize, #to_h

Methods included from Fields

adjust_field_options, included

Methods included from Fields::InstanceMethods

#[], #[]=, #assoc, #each_field, #each_field_name, #each_field_with_value, #each_pair, #each_value, #field_get, #field_set, #field_set!, #fields=, #fields_hash, #initialize_fields, #invalid?, #post_initialize_fields, #pre_initialize_fields, #reset_field, #reset_fields, #update_fields, #update_fields!, #valid?, #validate, #validate_fields?

Constructor Details

This class inherits a constructor from Moon::DataModel::Metal

Instance Attribute Details

#idString


11
# File 'lib/data_model/base.rb', line 11

field :id,   type: String,           default: proc { Random.random.base64(16) }

#metaHash<String, String>


27
# File 'lib/data_model/base.rb', line 27

dict :meta,  key: String, value: String

#nameString


15
# File 'lib/data_model/base.rb', line 15

field :name, type: String,           default: proc { '' }

#noteString


19
# File 'lib/data_model/base.rb', line 19

field :note, type: String,           default: proc { '' }

#tagsArray<String>


23
# File 'lib/data_model/base.rb', line 23

array :tags, type: String