Forum: Ruby What's does this double @ sign syntax mean after __END__

Ce1e13bbf946c92e2abf740f8909bafa?d=identicon&s=25 AR (aka AleiPhoenix) (Guest)
on 2013-11-12 09:46
(Received via mailing list)
Hi, list

I'm wondering what does double @ sign after __END__ syntax meaning like
in
this file[1]

single file sinatra app really impressed me :)

[1]:
https://github.com/syohex/emacs-realtime-markdown-...

--
Silence is golden.

twitter: @AccelReality
wikipedia: AleiPhoenix
blog: weblog.areverie.org
wiki: wiki.areverie.org
A7fca2db6ff3f4583df98043bd5166f9?d=identicon&s=25 Panagiotis Atmatzidis (Guest)
on 2013-11-12 10:06
(Received via mailing list)
Hello,

On 12 Νοε 2013, at 09:44 , AR (aka AleiPhoenix) <aleiphoenix@gmail.com>
wrote:

> Hi, list
>
> I'm wondering what does double @ sign after __END__ syntax meaning like in this
file[1]


Generally speaking it's a class variable.

In this context (sinatra classic) @@index marks  the index HTML page
structure in 'erb' (note line 12.. erb :index) which you will see when
you access the 'index.html' page.

> blog: weblog.areverie.org
> wiki: wiki.areverie.org
>


Panagiotis (atmosx) Atmatzidis

email:  atma@convalesco.org
URL:  http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
7223c62b7310e164eb79c740188abbda?d=identicon&s=25 Xavier Noria (fxn)
on 2013-11-12 12:23
(Received via mailing list)
Sinatra does a little bit of magic there.

You probably know that in Ruby the content after an __END__ token is
available via the DATA filehandle... as long as you are in the main file
passed to Ruby to execute.

Sinatra extends this idea to other files to offer inline templates,
processing __END__ by hand:


https://github.com/sinatra/sinatra/blob/master/lib...

Then, it evaluates the text accordingly.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.