Class: RecordField

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/plugin/datahub/datahub-record-schema.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, type) ⇒ RecordField

Returns a new instance of RecordField.



5
6
7
8
# File 'lib/fluent/plugin/datahub/datahub-record-schema.rb', line 5

def initialize(name, type)
    @name = name
    @type = type
end

Instance Method Details

#get_nameObject



10
11
12
# File 'lib/fluent/plugin/datahub/datahub-record-schema.rb', line 10

def get_name()
    return @name
end

#get_typeObject



14
15
16
# File 'lib/fluent/plugin/datahub/datahub-record-schema.rb', line 14

def get_type()
    return @type
end

#to_json(*a) ⇒ Object



18
19
20
21
22
23
# File 'lib/fluent/plugin/datahub/datahub-record-schema.rb', line 18

def to_json(*a)
    field_map = {}
    field_map["name"] = @name
    field_map["type"] = @type
    return field_map.to_json(*a)
end