Before we can get started programming with Ruby and Ruby on Rails, we need to make sure we have all of the different components involved to let us work efficiently and develop applications. This includes not only Ruby and Ruby on Rails but other tools as well. This post goes over what we’ll need to get Ruby and Rails up and running on our system.
Creating facebook alike, or mobile slide, push MENU with this jquery plugin is damm easy.
Pattern 5: “Crockford” Patterns
Continued from part 3
However, there’s something to be said for having constructor functions. Having a constructor function create an object for us gives to that encapsulation we want and makes the process easier; we don’t have to worry about wiring up the right things; it just works.
Pattern 3: Classical Pattern
(Continued from PART2)
The thing about this is that, since it’s not built in, we have to create (or find) a library that adds the classical features like
super methods, and easy inheritance. It’s reasonably complicated to create this kind of thing, so we’re going to work with two already-created libraries: Base.js and Mootools. I’ll mentions right here, though, that they aren’t the only ones that do this; if you’re interested in this topic, you might want to check out the function John Resig made to do this. Also, the Dojo Toolkit offers some functionality very similar to Mootool’s.
Pattern 1: Modules
The first pattern we’re going to look at is the Module Pattern. Here are a couple of the main features of the module pattern:
- No Inheritance: The module pattern doesn’t support inheritance by default. Of course, this doesn’t mean it’s impossible to inherit from it. After all, a module returns a single object, and you can inherit from any object. But that’s outside of the module pattern.
- Private variable and functions: This feature is almost the whole point of using the module pattern. If you just need a unique object, just use an object literal. However, what if you want to hide values or functionality? An object literal doesn’t offer any way to hide that stuff, so we’ll do it with closure … which is what the module pattern is, in essence.
So, let’s actually create a module.
SASS is CSS framework that supercharges your CSS habits. “Sass is the most mature, stable, and powerful professional grade CSS extension language in the world.” SASS = Semantically Awesome Stylesheet.
So, all this time in my most of the projects I was using LESS CSS, but from now on Im gonna use SASS, since I just came accross a site http://bourbon.io/