module Chef::EncryptedAttribute::Yajl
Helper module to abstract the required Yajl
(JSON) dependecy.
Public Class Methods
load_requirement(chef_version)
click to toggle source
Loads the required Yajl
JSON library depending on the installed Chef
version.
@return [Class] The correct JSON class to use.
# File lib/chef/encrypted_attribute/yajl.rb, line 32 def self.load_requirement(chef_version) if Gem::Requirement.new('< 11.13').satisfied_by?( Gem::Version.new(chef_version) ) require 'yajl' ::Yajl else require 'ffi_yajl' ::FFI_Yajl end end