Class: Array
Direct Known Subclasses
Instance Method Summary collapse
-
#matcher(opts = {}) ⇒ Object
call matcher on all of the elements.
- #pathify_strings ⇒ Object
Instance Method Details
#matcher(opts = {}) ⇒ Object
call matcher on all of the elements
169 170 171 172 173 |
# File 'lib/core_extensions.rb', line 169 def matcher(opts = {}) klone = self.clone klone.unshift(":matcher") VariableArray.new(klone.collect(&:matcher)) end |
#pathify_strings ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/core_extensions.rb', line 153 def pathify_strings if self.first == ":matcher" val = VariableArray.new(self) else val = self end val.each_with_index do |v,k| if v.is_a?(Array) || v.is_a?(Hash) val[k] = v.pathify_strings elsif v.instance_of?(String) || v.is_a?(Numeric) val[k] = PathString.new(URI.decode(v.to_s)) end end val end |