|
|
@ -42,14 +42,17 @@ module API |
|
|
|
property :format, |
|
|
|
property :format, |
|
|
|
exec_context: :decorator, |
|
|
|
exec_context: :decorator, |
|
|
|
getter: -> (*) { @format == '' ? 'plain' : @format }, |
|
|
|
getter: -> (*) { @format == '' ? 'plain' : @format }, |
|
|
|
writable: false |
|
|
|
writable: false, |
|
|
|
|
|
|
|
render_nil: true |
|
|
|
property :raw, |
|
|
|
property :raw, |
|
|
|
exec_context: :decorator, |
|
|
|
exec_context: :decorator, |
|
|
|
getter: -> (*) { represented } |
|
|
|
getter: -> (*) { represented }, |
|
|
|
|
|
|
|
render_nil: true |
|
|
|
property :html, |
|
|
|
property :html, |
|
|
|
exec_context: :decorator, |
|
|
|
exec_context: :decorator, |
|
|
|
getter: -> (*) { to_html }, |
|
|
|
getter: -> (*) { to_html }, |
|
|
|
writable: false |
|
|
|
writable: false, |
|
|
|
|
|
|
|
render_nil: true |
|
|
|
|
|
|
|
|
|
|
|
def to_html |
|
|
|
def to_html |
|
|
|
format_text(represented, format: @format, object: @object) |
|
|
|
format_text(represented, format: @format, object: @object) |
|
|
|