Class: PRRD::Graph::Comment
Overview
PRRD Comment Line class
Instance Attribute Summary
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(values = nil) ⇒ Comment
constructor
Constructor.
-
#to_s ⇒ Object
Transform to a COMMENT formatted string.
Methods inherited from Entity
#method_missing, #validate_presence
Constructor Details
#initialize(values = nil) ⇒ Comment
Constructor
11 12 13 14 15 16 17 |
# File 'lib/prrd/graph/comment.rb', line 11 def initialize(values = nil) @keys = [ :text ] 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 COMMENT formatted string
20 21 22 23 24 25 26 |
# File 'lib/prrd/graph/comment.rb', line 20 def to_s fail 'Empty comment object' if @data.empty? validate_presence :text "COMMENT:\"%s\"" % @data[:text] end |