Class: N::Property
- Inherits:
-
Object
- Object
- N::Property
- Defined in:
- lib/n/properties.rb
Overview
Property Metadata
Design:
-
add default value in the extra sql
Instance Attribute Summary collapse
-
#klass ⇒ Object
the class of the property.
-
#name ⇒ Object
the string representation of the symbol.
-
#sql ⇒ Object
extra sql options for the property.
-
#symbol ⇒ Object
the symbol of the property.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(symbol, klass, sql = nil) ⇒ Property
constructor
A new instance of Property.
Constructor Details
#initialize(symbol, klass, sql = nil) ⇒ Property
Returns a new instance of Property.
42 43 44 45 46 |
# File 'lib/n/properties.rb', line 42 def initialize(symbol, klass, sql = nil) @symbol, @klass = symbol, klass @sql = sql @name = @symbol.to_s() end |
Instance Attribute Details
#klass ⇒ Object
the class of the property
36 37 38 |
# File 'lib/n/properties.rb', line 36 def klass @klass end |
#name ⇒ Object
the string representation of the symbol
34 35 36 |
# File 'lib/n/properties.rb', line 34 def name @name end |
#sql ⇒ Object
extra sql options for the property. if set, it must contain the sql_type for this class, the default is overriden.
40 41 42 |
# File 'lib/n/properties.rb', line 40 def sql @sql end |
#symbol ⇒ Object
the symbol of the property
32 33 34 |
# File 'lib/n/properties.rb', line 32 def symbol @symbol end |
Instance Method Details
#==(other) ⇒ Object
48 49 50 |
# File 'lib/n/properties.rb', line 48 def ==(other) return @symbol == other.symbol end |