From 3ea75bb026b6ba9c5b4fecc3236e25bf696b5afe Mon Sep 17 00:00:00 2001 From: John Mair Date: Sun, 9 Oct 2011 06:48:17 +1300 Subject: [PATCH] added Pry::Indent#indent_level method as as short-hand for stack[-1] --- lib/pry/indent.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pry/indent.rb b/lib/pry/indent.rb index dea88d30..0834cd00 100644 --- a/lib/pry/indent.rb +++ b/lib/pry/indent.rb @@ -64,6 +64,12 @@ class Pry @stack.clear end + ## + # The current indentation level (number of spaces deep) + def indent_level + @stack.last + end + ## # Indents a string and returns it. This string can either be a single line # or multiple ones.