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.
20 21 22 |
# File 'lib/logidze/history/version.rb', line 20 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
18 19 20 |
# File 'lib/logidze/history/version.rb', line 18 def data @data end |
Instance Method Details
#changes ⇒ Object
28 29 30 |
# File 'lib/logidze/history/version.rb', line 28 def changes data.fetch(CHANGES) end |
#meta ⇒ Object
40 41 42 |
# File 'lib/logidze/history/version.rb', line 40 def data[META] end |
#responsible_id ⇒ Object
36 37 38 |
# File 'lib/logidze/history/version.rb', line 36 def responsible_id && [META_RESPONSIBLE] || data[RESPONSIBLE] end |
#time ⇒ Object
32 33 34 |
# File 'lib/logidze/history/version.rb', line 32 def time data.fetch(TS) end |
#version ⇒ Object
24 25 26 |
# File 'lib/logidze/history/version.rb', line 24 def version data.fetch(VERSION) end |