Class: N::Property

Inherits:
Object
  • Object
show all
Defined in:
lib/n/properties.rb

Overview

Property Metadata

Design:

  • add default value in the extra sql

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#klassObject

the class of the property



36
37
38
# File 'lib/n/properties.rb', line 36

def klass
  @klass
end

#nameObject

the string representation of the symbol



34
35
36
# File 'lib/n/properties.rb', line 34

def name
  @name
end

#sqlObject

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

#symbolObject

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