Method: Cisco::Client.munge_to_array
- Defined in:
- lib/cisco_node_utils/client/utils.rb
.munge_to_array(val) ⇒ Object
Make a best effort to convert a given input value to an Array. Strings are split by newlines, and nil becomes an empty Array.
26 27 28 29 30 |
# File 'lib/cisco_node_utils/client/utils.rb', line 26 def self.munge_to_array(val) val = [] if val.nil? val = val.split("\n") if val.is_a?(String) val end |