title: How to use method calls within rjust?
body: <p>As part of my ruby learning, I would like to call <code>size</code> method within <code>rjust</code> passing it as first parameter.  Not sure how to do it.</p>
  
  <p>For e.g.</p>
  
  <pre><code>2.to_s(2) #=&gt; returns "10" 
  </code></pre>
  
  <p>Now, I would like to use <code>rjust</code> on <code>10</code> passing <code>:size + 5</code> as first argument to get <code>*****10</code></p>
  
  <pre><code>2.to_s(2).rjust(how_to_get_size_of_10_and_add_5, "*") #=&gt; dont know how to.
  </code></pre>
  
  <p>Unsuccessfully, tried the below:</p>
  
  <pre><code>2.to_s(2).tap{|s| rjust(s.size+5,"*")} #=&gt; ...undefined method `rjust' for main:Object
  2.to_s(2).rjust(send(:size)+5,"*") #=&gt; ... undefined method `size' for main:Object
  </code></pre>
  
  <p>I am trying to understand how to refer and exercise a method on a part of chain of method calls. In my example I am trying to call <code>rjust</code> on <code>2.to_s(2)</code> and within rjust refer the <code>size</code> of <code>2.to_s(2)</code>.  Sorry if my writing is clumsy</p>