This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"/$controller"(parseRequest: true) { | |
action = [GET: "index", POST: "save"] | |
} | |
"/$controller/$id"(parseRequest: true) { | |
action = [GET: "show", PUT: "update", POST: "update", DELETE: "delete"] | |
constraints { | |
id matches: /\d+/ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_accessor :first_name, :last_name | |
def initialize(first_name, last_name) | |
self.first_name = first_name | |
self.last_name = last_name | |
end | |
end | |
require 'delegate' | |
class PersonDecorator < SimpleDelegator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String firstName | |
String lastName | |
} | |
class PersonDecorator { | |
private @Delegate Person person | |
def fullName() { | |
"$firstName $lastName" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Print the numbers 1..100 | |
//For multiples of 3, print "Fizz" instead of the number | |
//For multiples of 5, print "Buzz" instead of the number | |
//For multiples of 3 and 5, print "FizzBuzz" instead of the number | |
package main | |
import "fmt" | |
import "strconv" |