For some reason the .let and .lets methods were added in f312bc8, but they weren't implemented. This completes a basic implementation which defines "virtual" memoized methods on the resource.
Efficient reuse of expensive values in multiple properties
Cleans up model decorators even further
Example:
class UserPresenter < Jsonite
let(:full_name) { "#{first_name} #{last_name}" }
property :full_name
end
# {
# "full_name": "Stephen Celis"
# }
Downsides:
Third place where presentation methods are defined (context, resource, lets)
For some reason the .let and .lets methods were added in f312bc8, but they weren't implemented. This completes a basic implementation which defines "virtual" memoized methods on the resource.
Example:
Downsides: