README.md in representable-1.4.1 vs README.md in representable-1.4.2
- old
+ new
@@ -558,13 +558,15 @@
(Please don't read this section!)
* If you need a special binding for a property you're free to create it using the `:binding` option.
+<!-- here comes some code -->
property :title, :binding => lambda { |*args| JSON::TitleBinding.new(*args) }
* Lambdas are usually executed in the represented object's context. If your writing a `Decorator` representer and you need to execute lambdas in its context use the `:representer_exec` option.
+<!-- and some more in a beautiful cuddle -->
class SongRepresenter < Representable::Decorator
property :title, :representer_exec => true, :getter => lambda {..}
end
You can still access the represented object in the lambda using `represented`. In a module representer this option is ignored.
\ No newline at end of file