Class: ModelColumn
Instance Attribute Summary collapse
-
#limit ⇒ Object
if it’s not here, it’s probably from Sequel, so figure it out from the db_type.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, hash) ⇒ ModelColumn
constructor
A new instance of ModelColumn.
- #related_class ⇒ Object
Constructor Details
#initialize(name, hash) ⇒ ModelColumn
Returns a new instance of ModelColumn.
14 15 16 17 18 19 |
# File 'lib/clevic/model_column.rb', line 14 def initialize( name, hash ) super(hash) # must be after hash so it takes precedence @name = name end |
Instance Attribute Details
#limit ⇒ Object
if it’s not here, it’s probably from Sequel, so figure it out from the db_type
25 26 27 28 29 30 31 |
# File 'lib/clevic/model_column.rb', line 25 def limit unless @limit db_type =~ /\((\d+)\)/ @limit = $1.to_i end @limit end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/clevic/model_column.rb', line 21 def name @name end |
Instance Method Details
#related_class ⇒ Object
35 36 37 |
# File 'lib/clevic/model_column.rb', line 35 def @related_class ||= eval class_name end |