Class: PRRD::Graph::Print
Overview
PRRD Graph Line class
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(values = nil) ⇒ Print
constructor
Constructor.
-
#to_s ⇒ Object
Transform to a PRINT formatted string.
Methods inherited from Entity
#method_missing, #validate_presence
Constructor Details
#initialize(values = nil) ⇒ Print
Constructor
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/prrd/graph/print.rb', line 11 def initialize(values = nil) @keys = [ :gprint, :vname, :cf, :format, :strftime ] 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 PRINT formatted string
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/prrd/graph/print.rb', line 24 def to_s fail 'Empty print object' if @data.empty? validate_presence :vname, :cf, :format @data[:grpint] ||= false chunks = [] if @data.key?(:gprint) && @data[:gprint] == true chunks << 'GPRINT' else chunks << 'PRINT' end chunks << @data[:vname] chunks << @data[:cf] chunks << @data[:format] chunks << @data[:strftime] if @data.key?(:strftime) chunks.join ':' end |