Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between . and #

Tags:

ruby

rspec

In Ruby what is the difference between those two (in code):

  • Class.method
  • Class#method
like image 931
alex Avatar asked Oct 06 '12 21:10

alex


People also ask

What's the difference between single and double quotation marks?

General Usage Rules In America, Canada, Australia and New Zealand, the general rule is that double quotes are used to denote direct speech. Single quotes are used to enclose a quote within a quote, a quote within a headline, or a title within a quote.

What is the difference between single and double inverted commas?

Double quotation marks (in British English) are used to indicate direct speech within direct speech (use single inverted commas for direct speech and double quotation marks to enclose quoted material within).

What are single quotation marks used for?

Single quotation marks are also known as 'quote marks', 'quotes', 'speech marks' or 'inverted commas'. Use them to: show direct speech and the quoted work of other writers. enclose the title of certain works.

What is the difference between quotation marks and a single?

The use of single and double quotation marks when quoting differs between US and UK English. In US English, you must use double quotation marks. Single quotation marks are used for quotes within quotes.


1 Answers

It's a naming convention.

  • use pound #method for instance methods
  • use dot .method for class methods

See: How to name RSpec describe blocks for methods

like image 88
halex Avatar answered Sep 21 '22 06:09

halex