Class: OGTraf::Deviation
- Inherits:
-
Object
- Object
- OGTraf::Deviation
- Defined in:
- lib/ogtraf/deviation.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(datablock) ⇒ Deviation
constructor
A new instance of Deviation.
- #to_s ⇒ Object
Constructor Details
#initialize(datablock) ⇒ Deviation
Returns a new instance of Deviation.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ogtraf/deviation.rb', line 8 def initialize(datablock) @header = datablock[:Header] @summary = datablock[:Summary] || datablock[:PublicNote] @details = datablock[:Details] @text = datablock[:ShortText] @from = Time.now @to = Time.now datablock[:DeviationScopes].each do |dev| from = Time.parse dev[:FromDateTime] @from = from if @from > from to = Time.parse dev[:ToDateTime] @to = to if @to < to end end |
Instance Attribute Details
#details ⇒ Object (readonly)
Returns the value of attribute details.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def details @details end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def from @from end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def header @header end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def summary @summary end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def text @text end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
6 7 8 |
# File 'lib/ogtraf/deviation.rb', line 6 def to @to end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/ogtraf/deviation.rb', line 25 def to_s @header.to_s end |