Class: PRRD::Graph::Shift
Overview
PRRD Shift Line class
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(values = nil) ⇒ Shift
constructor
Constructor.
-
#to_s ⇒ Object
Transform to a SHIFT formatted string.
Methods inherited from Entity
#method_missing, #validate_presence
Constructor Details
#initialize(values = nil) ⇒ Shift
Constructor
11 12 13 14 15 16 17 18 |
# File 'lib/prrd/graph/shift.rb', line 11 def initialize(values = nil) @keys = [ :vname, :offset ] super values end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PRRD::Entity
Instance Method Details
#to_s ⇒ Object
Transform to a SHIFT formatted string
21 22 23 24 25 26 27 |
# File 'lib/prrd/graph/shift.rb', line 21 def to_s fail 'Empty shift object' if @data.empty? validate_presence :vname, :offset "SHIFT:%s:%s" % [@data[:vname], @data[:offset]] end |