Skip to content

Instantly share code, notes, and snippets.

@bricker
Created August 1, 2014 04:05
Show Gist options
  • Select an option

  • Save bricker/e28c23d9853c626f6247 to your computer and use it in GitHub Desktop.

Select an option

Save bricker/e28c23d9853c626f6247 to your computer and use it in GitHub Desktop.
[5] pry(main)> node
=> #(Element:0x3fe96c8209fc {
name = "img",
attributes = [
#(Attr:0x3fe96d4b23f0 {
name = "class",
value = "alignleft size-large wp-image-4517"
}),
#(Attr:0x3fe96d4b23dc { name = "title", value = "AwardeesSoCal2014" }),
#(Attr:0x3fe96d4b23c8 {
name = "src",
value = "http://lapressclub.org/wp-content/uploads/2014/06/AwardeesSoCal2014-600x413.jpg"
}),
#(Attr:0x3fe96d4b23b4 { name = "alt", value = "" }),
#(Attr:0x3fe96d4b23a0 { name = "width", value = "600" }),
#(Attr:0x3fe96d4b238c { name = "height", value = "413" })]
})
[6] pry(main)> node.children.count
=> 0
[7] pry(main)> node.children.all? { |n| n.name == "text" }
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment