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
- #association? ⇒ Boolean
-
#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
26 27 28 29 30 31 32 |
# File 'lib/clevic/model_column.rb', line 26 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
#association? ⇒ Boolean
22 |
# File 'lib/clevic/model_column.rb', line 22 def association?; association; end |
#related_class ⇒ Object
36 37 38 |
# File 'lib/clevic/model_column.rb', line 36 def @related_class ||= eval class_name end |