def raise_if_block(obj, name, has_block, type)
      return unless has_block

      SitePrism.logger.debug("Type passed in: #{type}")
      SitePrism.logger.warn('section / iFrame can only accept blocks.')
      SitePrism.logger.error("#{obj.class}##{name} does not accept blocks")

      raise SitePrism::UnsupportedBlockError
    end
def raise_if_block(obj, name, has_block, type)
      return unless has_block

      SitePrism.logger.debug("Type passed in: #{type}")
      SitePrism.logger.warn('section / iFrame can only accept blocks.')
      SitePrism.logger.error("#{obj.class}##{name} does not accept blocks")

      raise SitePrism::UnsupportedBlockError
    end
Prevent users from calling methods with blocks when they shouldn't be.

 Example (Triggering error):

       class MyPage
         element :sample, '.css-locator' do
           puts "This won't be output"
         end
       end

 At runtime this will generate a `SitePrism::UnsupportedBlockError`

 The only DSL keywords that can use blocks are :section and :iframe