Skip to content

Instantly share code, notes, and snippets.

@localhostdotdev
Last active April 26, 2019 21:29
Show Gist options
  • Save localhostdotdev/0e81e6f0a5ba662fe040cc1f2f99b84f to your computer and use it in GitHub Desktop.
Save localhostdotdev/0e81e6f0a5ba662fe040cc1f2f99b84f to your computer and use it in GitHub Desktop.

content_for(:false) { false }

  • content_for?(false) false
  • content_for(false) nil
  • yield(false) ""

content_for(:true) { true }

  • content_for?(true) false
  • content_for(true) nil
  • yield(true) ""

content_for(:nil) { nil }

  • content_for?(nil) false
  • content_for(nil) nil
  • yield(nil) ""

content_for(:""string"") { "string" }

  • content_for?("string") true
  • content_for("string") "string"
  • yield("string") "string"

content_for(:"" "") { " " }

  • content_for?(" ") false
  • content_for(" ") nil
  • yield(" ") " "

content_for(:"{}") { {} }

  • content_for?({}) false
  • content_for({}) nil
  • yield({}) ""

content_for(:"{:a=>1}") { {:a=>1} }

  • content_for?({:a=>1}) false
  • content_for({:a=>1}) nil
  • yield({:a=>1}) ""

content_for(:"[1, 2]") { [1, 2] }

  • content_for?([1, 2]) false
  • content_for([1, 2]) nil
  • yield([1, 2]) ""

content_for(:[]) { [] }

  • content_for?([]) false
  • content_for([]) nil
  • yield([]) ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment