Skip to content

Instantly share code, notes, and snippets.

@savethefails
savethefails / RubyScope.rb
Last active December 12, 2019 21:18
I found keeping track of 'self' in Ruby Classes to be exhausting, so I created this handy example illustrating when self changes, where instance variables are stored, and against which self methods are executed.
class RubyScope
# `self` is the RubyScope Class
# (i.e. an Instance of RubyScope MetaClass)
@variable_type = 'class instance variable'
# Methods are defined in a class, but executd on an instance
# Created on self: "RubyScope", Executed on self: "any instance of RubyScope"
def initialize
# `self` is an Instance of RubyScope Class
@variable_type = 'instance variable'
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
//
module.exports = function(grunt) {
grunt.initConfig({
// The clean task ensures all files are removed from the dist/ directory so
// that no files linger from previous builds.