Class: Ukemi::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/ukemi/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, first_seen: nil, last_seen: nil, source: nil) ⇒ Record

Returns a new instance of Record.



7
8
9
10
11
12
# File 'lib/ukemi/record.rb', line 7

def initialize(data:, first_seen: nil, last_seen: nil, source: nil)
  @data = data
  @first_seen = first_seen
  @last_seen = last_seen
  @source = source
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/ukemi/record.rb', line 5

def data
  @data
end

#first_seenObject (readonly)

Returns the value of attribute first_seen.



5
6
7
# File 'lib/ukemi/record.rb', line 5

def first_seen
  @first_seen
end

#last_seenObject (readonly)

Returns the value of attribute last_seen.



5
6
7
# File 'lib/ukemi/record.rb', line 5

def last_seen
  @last_seen
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/ukemi/record.rb', line 5

def source
  @source
end

Instance Method Details

#to_hObject



14
15
16
17
18
19
20
21
# File 'lib/ukemi/record.rb', line 14

def to_h
  {
    data: data,
    first_seen: first_seen,
    last_seen: last_seen,
    source: source
  }
end