Class: N::Property
Overview
Ruby attributes are typeless and generally this is good. Some times we need extra metadata though, for example in relational mapping, or web form population.
Only Fixnums, Strings, Floats, Times, Booleans are converted.
The default = methods do not force the types. A special __force_set method should be used instead. – TODO: Perhaps a sync is needed in evals (!!!!) ++
Instance Attribute Summary collapse
-
#klass ⇒ Object
the class of the property.
-
#meta ⇒ Object
additional metadata (like sql declaration, sql index, etc).
-
#name ⇒ Object
the string representation of the symbol.
-
#symbol ⇒ Object
the symbol of the property.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(symbol, klass, meta = {}) ⇒ Property
constructor
A new instance of Property.
- #to_s ⇒ Object
Constructor Details
#initialize(symbol, klass, meta = {}) ⇒ Property
Returns a new instance of Property.
49 50 51 52 53 |
# File 'lib/glue/property.rb', line 49 def initialize(symbol, klass, = {}) @symbol, @klass = symbol, klass @meta = @name = @symbol.to_s() end |
Instance Attribute Details
#klass ⇒ Object
the class of the property
43 44 45 |
# File 'lib/glue/property.rb', line 43 def klass @klass end |
#meta ⇒ Object
additional metadata (like sql declaration, sql index, etc)
47 48 49 |
# File 'lib/glue/property.rb', line 47 def @meta end |
#name ⇒ Object
the string representation of the symbol
39 40 41 |
# File 'lib/glue/property.rb', line 39 def name @name end |
#symbol ⇒ Object
the symbol of the property
35 36 37 |
# File 'lib/glue/property.rb', line 35 def symbol @symbol end |