Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

1# frozen_string_literal: true
2
3class REST::CollectionItemSerializer < ActiveModel::Serializer
4 delegate :accepted?, to: :object
5
6 attributes :id, :position, :state
7
8 belongs_to :account, serializer: REST::AccountSerializer, if: :accepted?
9
10 def id
11 object.id.to_s
12 end
13end
14

After

1# frozen_string_literal: true
2
3class REST::CollectionItemSerializer < ActiveModel::Serializer
4 delegate :accepted?, to: :object
5
6 attributes :id, :state
7
8 attribute :account_id, if: :accepted?
9
10 def id
11 object.id.to_s
12 end
13
14 def account_id
15 object.account_id.to_s
16 end
17end
18

Before

program
comment "# frozen_string_literal: true"
class
class "class"
scope_resolution
constant "REST"
:: "::"
constant "CollectionItemSerializer"
superclass
< "<"
scope_resolution
constant "ActiveModel"
:: "::"
constant "Serializer"
body_statement
call
identifier "delegate"
argument_list
simple_symbol ":accepted?"
, ","
pair
hash_key_symbol "to"
: ":"
simple_symbol ":object"
call
identifier "attributes"
argument_list
simple_symbol ":id"
, ","
simple_symbol ":position"
, ","
simple_symbol ":state"
call
identifier "belongs_to"
argument_list
simple_symbol ":account"
, ","
pair
hash_key_symbol "serializer"
: ":"
scope_resolution
constant "REST"
:: "::"
constant "AccountSerializer"
, ","
pair
hash_key_symbol "if"
: ":"
simple_symbol ":accepted?"
method
def "def"
identifier "id"
body_statement
call
call
identifier "object"
. "."
identifier "id"
. "."
identifier "to_s"
end "end"
end "end"

After

program
comment "# frozen_string_literal: true"
class
class "class"
scope_resolution
constant "REST"
:: "::"
constant "CollectionItemSerializer"
superclass
< "<"
scope_resolution
constant "ActiveModel"
:: "::"
constant "Serializer"
body_statement
call
identifier "delegate"
argument_list
simple_symbol ":accepted?"
, ","
pair
hash_key_symbol "to"
: ":"
simple_symbol ":object"
call
identifier "attributes"
argument_list
simple_symbol ":id"
, ","
simple_symbol ":state"
call
identifier "attribute"
argument_list
simple_symbol ":account_id"
, ","
pair
hash_key_symbol "if"
: ":"
simple_symbol ":accepted?"
method
def "def"
identifier "id"
body_statement
call
call
identifier "object"
. "."
identifier "id"
. "."
identifier "to_s"
end "end"
method
def "def"
identifier "account_id"
body_statement
call
call
identifier "object"
. "."
identifier "account_id"
. "."
identifier "to_s"
end "end"
end "end"