Title / Description
Code class RevealingRefrences attr_reader :wheels def initialize(data) @wheels = wheelify(data) end def diameter wheels.map { |wheel| wheel.rim + (wheel.tire*2) } end Wheel = Struct.new(:rim, :tire) def wheelify(data) data.colect{ |d| Wheel.new(d[0], d[1]) } end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code