what ruby language construct is respond_to in rails?
===

I am new to ruby and rails. Can someone please point out what is the below construct. I see the respond_to constructs in methods (def). So is it a method inside a method ? I mean I am trying to understand the language construct here. 

I do understand its functionality, that is send the response in a given format. 

        respond_to do |format|
          format.html # index.html.erb
          format.json { render json: @posts }
        ends