Module: Rack::Test::Body::YAML

Included in:
MockResponse
Defined in:
lib/rack/test/body/yaml.rb

Instance Method Summary collapse

Instance Method Details

#parse_text(content_type, content, symbolize_keys: false) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/rack/test/body/yaml.rb', line 31

def parse_text(content_type, content, symbolize_keys: false)
	if yaml?(content_type)
		::YAML.load(content)
	else
		super
	end
end

#yaml?(content_type = self.content_type) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/rack/test/body/yaml.rb', line 27

def yaml?(content_type = self.content_type)
	content_type.start_with? "application/yaml"
end