travis-ci
394 of 394 new or added lines in 14 files covered. (100.0%)
11674 of 42859 relevant lines covered (27.24%)
6783.15 hits per line
1 |
module Ekylibre |
2✔ |
2 |
module Schema |
2✔ |
3 |
class Column |
2✔ |
4 |
attr_reader :name, :type, :limit, :default, :precision, :references, :scale, :options |
2✔ |
5 |
|
|
6 |
def initialize(name, type, options = {}) |
2✔ |
7 |
@name = name.to_sym
|
4,368✔ |
8 |
@type = type.to_sym
|
4,368✔ |
9 |
@options = options.merge(name: @name, type: @type) |
4,368✔ |
10 |
@null = !@options[:null].is_a?(FalseClass) |
4,368✔ |
11 |
@default = @options[:default] |
4,368✔ |
12 |
@limit = @options[:limit] |
4,368✔ |
13 |
@precision = @options[:precision] |
4,368✔ |
14 |
@scale = @options[:scale] |
4,368✔ |
15 |
@references = @options[:references] |
4,368✔ |
16 |
end
|
|
17 |
|
|
18 |
def [](value) |
2✔ |
19 |
@options[value]
|
10,070✔ |
20 |
end
|
|
21 |
|
|
22 |
def null? |
2✔ |
23 |
@null
|
× |
24 |
end
|
|
25 |
|
|
26 |
def references? |
2✔ |
27 |
!@references.blank?
|
× |
28 |
end
|
|
29 |
|
|
30 |
def polymorphic? |
2✔ |
31 |
@references.is_a?(String) |
× |
32 |
end
|
|
33 |
end
|
|
34 |
end
|
|
35 |
end
|