Class: Logidze::History::Version
- Inherits:
-
Object
- Object
- Logidze::History::Version
- 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'
- META_RESPONSIBLE =
Meta Responsible ID
'_r'
- META =
Meta key
'm'
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #changes ⇒ Object
-
#initialize(data) ⇒ Version
constructor
A new instance of Version.
- #meta ⇒ Object
- #responsible_id ⇒ Object
- #time ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(data) ⇒ Version
Returns a new instance of Version.
19 20 21 |
# File 'lib/logidze/history/version.rb', line 19 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
17 18 19 |
# File 'lib/logidze/history/version.rb', line 17 def data @data end |
Instance Method Details
#changes ⇒ Object
27 28 29 |
# File 'lib/logidze/history/version.rb', line 27 def changes data.fetch(CHANGES) end |
#meta ⇒ Object
39 40 41 |
# File 'lib/logidze/history/version.rb', line 39 def data[META] end |
#responsible_id ⇒ Object
35 36 37 |
# File 'lib/logidze/history/version.rb', line 35 def responsible_id && [META_RESPONSIBLE] || data[RESPONSIBLE] end |
#time ⇒ Object
31 32 33 |
# File 'lib/logidze/history/version.rb', line 31 def time data.fetch(TS) end |
#version ⇒ Object
23 24 25 |
# File 'lib/logidze/history/version.rb', line 23 def version data.fetch(VERSION) end |