class PRRD::Graph::Textalign

PRRD Textalign Line class

Public Class Methods

new(values = nil) click to toggle source

Constructor

Calls superclass method PRRD::Entity::new
# File lib/prrd/graph/textalign.rb, line 11
def initialize(values = nil)
  @keys = [
    :orientation
  ]

  super values
end

Public Instance Methods

to_s() click to toggle source

Transform to a TEXTALIGN formatted string

# File lib/prrd/graph/textalign.rb, line 20
def to_s
  fail 'Empty textalign object' if @data.empty?

  validate_presence :orientation
  unless ['left', 'right', 'justified', 'center'].include? @data[:orientation].to_s
    fail 'Orientation option muts be: left|right|justified|center'
  end

  "TEXTALIGN:\"%s\"" % @data[:orientation]
end