Class: Esquema::VirtualColumn
- Inherits:
-
Object
- Object
- Esquema::VirtualColumn
- Defined in:
- lib/esquema/virtual_column.rb
Overview
rubocop:disable Style/Documentation
Instance Method Summary collapse
- #class_name ⇒ Object
- #collection? ⇒ Boolean
- #columns ⇒ Object
- #default ⇒ Object
- #description ⇒ Object
-
#initialize(property_name, options = {}) ⇒ VirtualColumn
constructor
A new instance of VirtualColumn.
- #item_type ⇒ Object
- #name ⇒ Object
- #title ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(property_name, options = {}) ⇒ VirtualColumn
Returns a new instance of VirtualColumn.
5 6 7 8 |
# File 'lib/esquema/virtual_column.rb', line 5 def initialize(property_name, = {}) @property_name = property_name @options = end |
Instance Method Details
#class_name ⇒ Object
14 15 16 |
# File 'lib/esquema/virtual_column.rb', line 14 def class_name @property_name.to_s.classify end |
#collection? ⇒ Boolean
42 43 44 |
# File 'lib/esquema/virtual_column.rb', line 42 def collection? @options[:type] == :array end |
#columns ⇒ Object
38 39 40 |
# File 'lib/esquema/virtual_column.rb', line 38 def columns [] end |
#default ⇒ Object
26 27 28 |
# File 'lib/esquema/virtual_column.rb', line 26 def default @options[:default] end |
#description ⇒ Object
34 35 36 |
# File 'lib/esquema/virtual_column.rb', line 34 def description @options[:description] end |
#item_type ⇒ Object
22 23 24 |
# File 'lib/esquema/virtual_column.rb', line 22 def item_type @options.dig(:items, :type) end |
#name ⇒ Object
10 11 12 |
# File 'lib/esquema/virtual_column.rb', line 10 def name @property_name.to_s end |
#title ⇒ Object
30 31 32 |
# File 'lib/esquema/virtual_column.rb', line 30 def title @options[:title] end |
#type ⇒ Object
18 19 20 |
# File 'lib/esquema/virtual_column.rb', line 18 def type @options[:type] end |