Class SimpleZDB::Card
In: lib/simplezdb/card.rb
Parent: Object

Methods

[]   []=   categories   categories=   define_accessors   delete   each   keys   new   save   to_hash  

Included Modules

Enumerable

External Aliases

to_a -> to_ary

Attributes

card_id  [R] 
database  [R] 

Public Class methods

define accessors named by hash key.

Create a new Card object. You should specify valid DataBase object and card_id (Integer). If card_id is 0, it is treated as a new card.

Public Instance methods

Return the item associated with key. The type of the item is determined by the corresponding element of database.item_info.

Assign the value associated with the key of the card. Values are stored temporary on memory. To save data, call card.save. The type of the value should correspond to the element of database.item_info.

Return categories of the card.

Assign the categories of the card.

Iterate the values of the card. The order is the same as of the item_info.names of the database.

Return keys of the card.

Save the temporary data to database file.

Return key-value pairs of the card as hash.

[Validate]