class MultiMovingsign::LineDefinition

Attributes

line_segments[RW]
prefix[RW]

Public Class Methods

from_hash(hash) click to toggle source
# File lib/multi_movingsign/page_renderer.rb, line 101
def self.from_hash(hash)
  obj = self.new

  obj.prefix = hash['prefix'] || nil
  obj.line_segments = (hash['segments'] || hash['content'] || []).map { |segment| LineSegment.new(obj.prefix, segment) }

  obj
end

Public Instance Methods

prefix?() click to toggle source
# File lib/multi_movingsign/page_renderer.rb, line 110
def prefix?
  !!self.prefix
end