Class: TypedData::Schema::LongType

Inherits:
Type
  • Object
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

Constructor Details

This class inherits a constructor from TypedData::Schema::Type

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

Returns:

  • (Boolean)


24
25
26
# File 'lib/typed_data/schema/long_type.rb', line 24

def match?(value)
  value.is_a?(Integer)
end

#primitive?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/typed_data/schema/long_type.rb', line 20

def primitive?
  true
end

#to_sObject



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