Commits

Anonymous committed d22035b

fixed ruby code

  • Participants
  • Parent commits fe8fb50

Comments (0)

Files changed (1)

File _posts/2012-10-25-dynamic_attributes.md

 
 ### fluid-let
 
-~~~
+~~~clojure
 
 (define counter 0)
 (define (bump-counter!) (set! counter (+ 1 counter)) counter)
 See how the counter is temporarily set to 10 and restored to 0 after the fluid-let body.
 
 ### Parameters (SRFI-39)
-~~~
+
+~~~clojure
 (define context (make-parameter ""))
 
 (define (log message)
 
 But let's get back to ruby now. The following piece of code illustrates what a ruby-version of this could look like:
 
-~~~
+~~~ruby
 class MyLogger
   dynamic_attr :context
 
 
 Without further ado, here is the implementation that makes the above code possible:
 
-{%highlight ruby%}
+~~~ruby
 class Module
   def dynamic_attr(*names)
     attr_accessor *names
     end
   end
 end
-{%endhighlight%}
+~~~