Class: TypedData::Schema::LongType
- Inherits:
-
Type
- Object
- Type
- TypedData::Schema::LongType
show all
- Defined in:
- lib/typed_data/schema/long_type.rb
Constant Summary
collapse
- SUPPORTED_LOGICAL_TYPES =
%w[time-micros timestamp-millis timestamp-micros]
Instance Method Summary
collapse
Methods inherited from Type
#initialize
Instance Method Details
#accept(visitor, value) ⇒ Object
8
9
10
|
# File 'lib/typed_data/schema/long_type.rb', line 8
def accept(visitor, value)
visitor.visit_long(self, @logical_type, value)
end
|
#match?(value) ⇒ Boolean
24
25
26
|
# File 'lib/typed_data/schema/long_type.rb', line 24
def match?(value)
value.is_a?(Integer)
end
|
#primitive? ⇒ Boolean
20
21
22
|
# File 'lib/typed_data/schema/long_type.rb', line 20
def primitive?
true
end
|
#to_s ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/typed_data/schema/long_type.rb', line 12
def to_s
if @logical_type
"#{@name}_#{@logical_type.gsub("-", "_")}"
else
@name
end
end
|