Module: Substance::Objects::Output

Extended by:
ActiveSupport::Concern
Included in:
Substance::OutputObject
Defined in:
lib/substance/objects/output.rb

Instance Method Summary collapse

Instance Method Details

#output_structObject



55
56
57
# File 'lib/substance/objects/output.rb', line 55

def output_struct
  Struct.new(*_outputs)
end

#outputsObject



49
50
51
52
53
# File 'lib/substance/objects/output.rb', line 49

def outputs
  return {} if _outputs.empty?

  output_struct.new(*_outputs.map(&method(:public_send)))
end

#validated_output?(method) ⇒ Boolean

Returns:

  • (Boolean)


59
60
61
62
63
64
65
# File 'lib/substance/objects/output.rb', line 59

def validated_output?(method)
  validated? || begin
    attr_name = method.to_s.delete("=").to_sym

    _options.include?(attr_name) || _arguments.include?(attr_name)
  end
end