Class: Esquema::VirtualColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/esquema/virtual_column.rb

Overview

rubocop:disable Style/Documentation

Instance Method Summary collapse

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, options = {})
  @property_name = property_name
  @options = options
end

Instance Method Details

#class_nameObject



14
15
16
# File 'lib/esquema/virtual_column.rb', line 14

def class_name
  @property_name.to_s.classify
end

#collection?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/esquema/virtual_column.rb', line 42

def collection?
  @options[:type] == :array
end

#columnsObject



38
39
40
# File 'lib/esquema/virtual_column.rb', line 38

def columns
  []
end

#defaultObject



26
27
28
# File 'lib/esquema/virtual_column.rb', line 26

def default
  @options[:default]
end

#descriptionObject



34
35
36
# File 'lib/esquema/virtual_column.rb', line 34

def description
  @options[:description]
end

#item_typeObject



22
23
24
# File 'lib/esquema/virtual_column.rb', line 22

def item_type
  @options.dig(:items, :type)
end

#nameObject



10
11
12
# File 'lib/esquema/virtual_column.rb', line 10

def name
  @property_name.to_s
end

#titleObject



30
31
32
# File 'lib/esquema/virtual_column.rb', line 30

def title
  @options[:title]
end

#typeObject



18
19
20
# File 'lib/esquema/virtual_column.rb', line 18

def type
  @options[:type]
end