27 Apr '12, 12am

Memoizable#memoize - Example from Code School #rails

# include InstanceMethods # if method_defined?(:#{original_method}) # if method_defined?(:_unmemoized_mime_type) raise "Already memoized #{symbol}" # raise "Already memoized mime_type" end # end alias #{original_method} #{symbol} # alias _unmemoized_mime_type mime_type # if instance_method(:#{symbol}).arity == 0 # if instance_method(:mime_type).arity == 0 def #{symbol}(reload = false) # def mime_type(reload = false) if reload || !defined?(#{memoized_ivar}) || #{memoized_ivar}.empty? # if reload || !defined?(@_memoized_mime_type) || @_memoized_mime_type.empty? #{memoized_ivar} = [#{original_method}] # @_memoized_mime_type = [_unmemoized_mime_type] end # end #{memoized_ivar}[0] # @_memoized_mime_type[0] end # end else # else def #{symbol}(*args) # def mime_type(*args) #{memoized_ivar} ||= {} unless frozen? # @_memoized_mime_type ||= {} unless frozen? args_length = method(:#{...

Full article: http://apidock.com/rails/ActiveSupport/Memoizable/memoize...

Tweets

New Jersey School Converts to Solar

New Jersey School Converts to Solar

getsolar.com 26 Apr '12, 11pm

New Jersey School Converts to Solar Thursday, April 26th 2012 5:19 PM By GetSolar Staff. New Jersey recently increased its...

What is good code?

robots.thoughtbot.com 25 Apr '12, 1pm

April 25, 2012 Tagged: quality Comments (View) What is good code? We often discuss the principles we use to write what we ...

Rails Searchable API Doc:

Rails Searchable API Doc:

railsapi.com 25 Apr '12, 1am

Rails S earch able API Doc beta :) Smart search, beautifully packed Rails v3.0.8rc1 or Rails v3.0.8rc1 + Ruby v1.9.2 or bu...

Sam Ruby: Wunderbar on Rails

intertwingly.net 24 Apr '12, 10pm

Wunderbar on Rails Tue 24 Apr 2012 at 21:12 Usage: add wunderbar and nokogiri to your Gemfile and run bundle install . Tem...

Devise, CanCan and Twitter Bootstrap for Rails:...

rubyflow.com 20 Apr '12, 1am

GitHub repo: an example app for Rails, Twitter Bootstrap, Devise, and CanCan . Twitter Bootstrap is coming on strong as a ...

Concerned about Code Reuse?

rubyflow.com 20 Apr '12, 4pm

Concerned about Code Reuse? Posted by schneems on April 20, 2012 — 4 comments If you're concerned about code reuse in Ruby...

STR Skill School Is YouTube’s April On The Rise Winner, Here’s Why

STR Skill School Is YouTube’s April On The Rise...

reelseo.com 26 Apr '12, 6pm

The YouTube Blog announced that STR Skill School, a channel dedicated to showing soccer tips and tricks, is April’s winner...

New Rails Issue: Users Guide is ... https://t.c...

guides.rubyonrails.org 23 Apr '12, 8pm

is a connection between two Active Record models. Associations are implemented using macro-style calls, so that you can de...

This Week in Ruby: Rails 3.2, Rails Tutorial, a...

rubyinside.com 20 Apr '12, 4am

It's the latest Web-based syndication of Ruby Weekly , the weekly Ruby and Rails e-mail newsletter (which just tipped 11K ...

Getting Started with Rails:

guides.rubyonrails.org 19 Apr '12, 1am

Rails is a web application development framework written in the Ruby language. It is designed to make programming web appl...

Redmineは次のメジャーバージョンアップ(2.0)でRails 3.2.xに移行します。お...

redmine.org 25 Apr '12, 7pm

As announced previously, the next major release of Redmine (2.0) will run with Rails 3.2. Today, the development branch wa...

Rails Internals: Secure Password

rubyflow.com 24 Apr '12, 7pm

Rails Internals: Secure Password Posted by oscardb on April 24, 2012 — 0 comments Another article in the Rails internals s...

#Pingpong - School Sports: Paddlers deliver epi...

todayonline.com 24 Apr '12, 1pm

SINGAPORE - The pitter patter of ping-pong balls was silenced by the roars and cheers of some 2,000 supporters at the Toa ...

You should try automated static code analysis

rubyflow.com 23 Apr '12, 12pm

You should try automated static code analysis Posted by markoa on April 23, 2012 — 0 comments I followed John Carmack's ad...