class MatterCompiler::Headers
Headers
collection Blueprint
AST node
represents 'headers section'
Constants
- CONTENT_TYPE_HEADER_KEY
HTTP 'Content-Type' header
Public Instance Methods
content_type()
click to toggle source
@return [String] the value of 'Content-type' header if present or nil
# File lib/matter_compiler/blueprint.rb, line 130 def content_type content_type_header = @collection.detect { |header| header.has_key?(CONTENT_TYPE_HEADER_KEY) } return (content_type_header.nil?) ? nil : content_type_header[CONTENT_TYPE_HEADER_KEY] end
serialize(level = 0, ignore_keys = nil)
click to toggle source
Calls superclass method
MatterCompiler::KeyValueCollection#serialize
# File lib/matter_compiler/blueprint.rb, line 120 def serialize(level = 0, ignore_keys = nil) return "" if @collection.blank? || filter_collection(ignore_keys).blank? buffer = "" level.times { buffer << ONE_INDENTATION_LEVEL } buffer << "+ Headers\n\n" buffer << super(level + 2, ignore_keys) end