January 1, 2015 by Daniel P. Clark

When to use Ampersand and/or Colon with Proc, Map, and Inject

So with Ruby permitting Procs called on Objects I’ve found sometimes a Colon Method will work, and sometimes you need a Ampersand Colon Method.  For example, when I map &:upcase on a list of strings it works. [“a”,”b”,”c”].map(&:upcase) # = > [“A”, “B”, “C”] But if I try without the Ampersand I get: [“a”,”b”,”c”].map(:upcase) #…

Continue Reading »

December 27, 2014 by Daniel P. Clark

“Assume Everything Will Break” Development

In Ruby, and Ruby on Rails, the community is very big on Test Driven Development (TDD). This is good! And it’s especially important when working with a team. But what patterns will you develop in buidling a huge Rails application on your own without tests? Well I’d like to call it “Assume Everything Will Break…

Continue Reading »

December 26, 2014 by Daniel P. Clark

Free Travis CI for your Open Source project

So as I was poking around and looking at Travis CI and I noticed they give their service for free to open source projects.  This is cool!  Give your project more credibility by using it. So what is Travis CI?  Well it’s basically a tool to run your software tests within several environments and give you…

Continue Reading »

December 9, 2014 by Daniel P. Clark

Ruby & Ruby on Rails Methods for Discovery Part 1

When I program I see it as both an art and a challenge.  The art is in the how.  The challenges I see as detective work.  The answer is unknown as of yet, and it’s your job to sleuth it out.  A detective hunts down the clues until an answer is found.  Yes, that is…

Continue Reading »

August 4, 2014 by Daniel P. Clark

Create a Game Instance in Rails

So you need to load a class instance in Rails for your visitors to play your game. But Rails generally is a static website with static database lookups. So for this we’re going to assign a class instance to a game room. First let’s generate our project; we’re going to start with a prebuilt devise/bootstrap…

Continue Reading »

August 1, 2014 by Daniel P. Clark

Manual Polymorphic Creation in Rails

Finding documentation online to do this was pretty much a no go.  The answer I’ve provided here was grasped from hints given on many websites of what could be done but without anything I could really sink my teeth into. What this code allows you to accomplish is to create a belongs_to/has_many relationship to something…

Continue Reading »

Page 8 of 8
1 6 7 8
1 6 7 8