class Stairwell::Types::InType

Attributes

type[R]
value[R]

Public Class Methods

new(value, type) click to toggle source
# File lib/stairwell/types/in_type.rb, line 7
def initialize(value, type)
  @value = value
  @type = type
end

Public Instance Methods

quote() click to toggle source
# File lib/stairwell/types/in_type.rb, line 12
def quote
  contained_values.map(&:quote).join(", ")
end
valid?() click to toggle source
# File lib/stairwell/types/in_type.rb, line 16
def valid?
  value.is_a?(Array) && contained_values.all?(&:valid?)
end

Private Instance Methods

contained_values() click to toggle source
# File lib/stairwell/types/in_type.rb, line 22
def contained_values
  value.map do |contained|
    Object.const_get(Stairwell::TYPE_CLASSES[type]).new(contained)
  end
end