Class: Logidze::History::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/logidze/history/version.rb

Overview

Represents one log item

Constant Summary collapse

TS =

Timestamp key

'ts'
CHANGES =

Changes key

'c'
RESPONSIBLE =

Responsible ID

'r'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Version

Returns a new instance of Version.



15
16
17
# File 'lib/logidze/history/version.rb', line 15

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



13
14
15
# File 'lib/logidze/history/version.rb', line 13

def data
  @data
end

Instance Method Details

#changesObject



23
24
25
# File 'lib/logidze/history/version.rb', line 23

def changes
  data.fetch(CHANGES)
end

#responsible_idObject



31
32
33
# File 'lib/logidze/history/version.rb', line 31

def responsible_id
  data[RESPONSIBLE]
end

#timeObject



27
28
29
# File 'lib/logidze/history/version.rb', line 27

def time
  data.fetch(TS)
end

#versionObject



19
20
21
# File 'lib/logidze/history/version.rb', line 19

def version
  data.fetch(VERSION)
end