class PBRT::Values

Public Class Methods

new(*inner) click to toggle source
# File lib/pbrt/values.rb, line 3
def initialize(*inner)
  @inner = inner.flatten
end

Public Instance Methods

size() click to toggle source
# File lib/pbrt/values.rb, line 11
def size
  @inner.size
end
to_s() click to toggle source
# File lib/pbrt/values.rb, line 7
def to_s
  @inner.map { |v| format(v) }.join(" ")
end

Private Instance Methods

format(value) click to toggle source
# File lib/pbrt/values.rb, line 17
def format(value)
  return '"true"' if value.is_a?(TrueClass)
  return '"false"' if value.is_a?(FalseClass)
  return %("#{value}") if value.is_a?(String)

  value
end