Class: Psych::Visitors::YAMLTree
- Inherits:
-
Object
- Object
- Psych::Visitors::YAMLTree
- Defined in:
- lib/asir/coder/yaml.rb
Instance Method Summary collapse
Instance Method Details
#binary?(string) ⇒ Boolean
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/asir/coder/yaml.rb', line 44 def binary? string return false if @options[:never_binary] result = string.index("\x00") || string.count("\x00-\x7F", "^ -~\t\r\n").fdiv(string.length) > 0.3 unless @options[:ASCII_8BIT_ok] result ||= string.encoding == Encoding::ASCII_8BIT end result end |
#binary_without_option? ⇒ Object
43 |
# File 'lib/asir/coder/yaml.rb', line 43 alias :binary_without_option? :binary? |