lib/htty/cli/command.rb
# Yields the last request in #session. If the block returns a different
# request, it is added to the requests of #session.
Yields the last request in #session. If the block returns a different
request, it is added to the requests of #session.
Yields the last request in #session . If the block returns a different request it is added to the requests of #session .
def add_request_if_new
    last_request = session.requests.last
    maybe_next_request = yield(last_request)
    session.requests << maybe_next_request unless (
      maybe_next_request.nil? or maybe_next_request.equal?(last_request)
    )
    self
  end
def add_request_if_new last_request = session . requests . last maybe_next_request = yield ( last_request ) session . requests << maybe_next_request unless ( maybe_next_request . nil? or maybe_next_request . equal? ( last_request ) ) self end
Yields the last request in #session.
Yields the last request in #session .