Create a gist now

Instantly share code, notes, and snippets.

Gist #9 For "Functional Programming Techniques With Ruby: Part I"
class CssBlock
# ...
def to_s
serialised_properties = self.properties.inject([]) do |acc, (k, v)|
acc + ["#{k}: #{v}"]
end
"#{self.selector} { #{serialised_properties.join("; ") } }"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment