Method: Forematter::Frontmatter#delete
- Defined in:
- lib/forematter/frontmatter.rb
#delete(key) ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/forematter/frontmatter.rb', line 40 def delete(key) data.children.each_index do |i| next unless i % 2 if data.children[i].to_ruby == key val = data.children.delete_at(i + 1) data.children.delete_at(i) return val end end end |