When Dick rents a room on Mott Street from Mrs. Mooney, he amazes his landlady by telling her, in a moment of dramatic irony, that he's coming from Astor House:
“I’ll bring over my baggage from the Astor House this evening,” said Dick in a tone of importance.
“From the Astor House!” repeated Mrs. Mooney, in fresh amazement.
“Yes, I’ve been stoppin’ there a short time with some friends,” said Dick.
This statement rightly astounds Mrs. Mooney, since the Astor House was one of America's most famous luxury hotels at the time of Alger's writing. Technically, Dick is telling the truth (as befits his honest personality) because Frank and Mr. Whitney are staying at the hotel, and he did leave some belongings with him. But because of the way Dick phrases this statement, Mrs. Mooney believes that he's a wealthy young man. This is an instance of dramatic irony because her incorrect understanding of the situation is so different from what the reader knows to be true of Dick's circumstances.
Much like the verbal irony Dick employs in his self-deprecating jokes, dramatic irony injects a note of humor into the narrative here and helps to sustain the novel's general mood. This episode also reminds the reader of Dick's mischievous personality: though he's too honorable to actually lie to anyone, Dick is clever enough to make fun of himself and others in more subtle ways. More broadly, this moment of dramatic irony sets the stage for Dick's journey of upward mobility. While the thought that he might stay at the Astor House is ironic enough to seem absurd at this point in the novel, such a prospect is not so hard to imagine by the end.
Dick is a quick talker and never tires of cracking jokes, even with people he's just met. Many of his jokes derive their humor from the suggestion that Dick is a wealthy or prominent figure, when he and his interlocutors know well that he's a poor and insignificant boot-black. These jokes are examples of verbal irony, since the literal meaning of Dick's words is very different from what he actually means.
Dick's references to his "Erie shares" are a recurring example of this verbal irony. Referring to the Erie Railroad, then a prominent interstate rail company, Dick often suggest that he owns stock, or "shares," in the company. He also tells people that he doesn't have money to spend because it's "invested" in the railroad. Of course, Dick doesn't have any "Erie shares;" he simply has no money at all. Through this verbal irony, he makes a self-deprecating joke about his own poverty.
The novel contains many one-off instances of irony as well. Take, for instance, when Fosdick tells Dick that his name has been listed in the newspaper:
“Yes,” said Dick, who was busy at the wash-stand, endeavoring to efface the marks which his day’s work had left upon his hands. “They haven’t put me up for mayor, have they? ’Cause if they have, I shan’t accept. It would interfere too much with my private business.”
Here, the irony lies in Dick's comic statement that he's a candidate for mayor—a joke that's especially funny because he's in the midst of washing away the evidence of his far more humble line of work.
Ironic quips like these provide much of the novel's humor and sustain the reader's interest. They show that Dick is smart and clever, even if he initially lacks formal education. Moreover, they establish his honesty: he's not ashamed of being poor and doesn't mind bringing attention to his circumstances. Making poverty seem like a matter of humor and not hardship, these moments of verbal irony help bolster Ragged Dick's optimistic and cheerful mood.
Crucially, Dick actually makes some of these absurd statements come true through hard work and self-improvement. When Dick opens a bank account, a major milestone in his journey of thrift, he reflects that he has "been accustomed to joke about Erie shares, but now, for the first time, he felt himself a capitalist." While he doesn't exactly have enough money to invest now, he's well on his way to becoming the kind of man to whom he jokingly compared himself. By the end of the novel, statements that seem ironically funny at the outset no longer seem absurdly out of reach. In this sense, the novel's verbal irony contributes to the respect and admiration Alger hopes to elicit in his readers.