Class: Kerbi::Cli::EntryRowSerializer
Instance Attribute Summary
#context, #object, #parent_object
Instance Method Summary
collapse
#colored_tag, #defined_or_na
associations, #attribute_value, attributes, has_attributes, has_many, has_one, header_titles, #initialize, #key, #limit_has_many, possessions, #serialize, serialize, #serialize_associations, #serialize_flat_attrs, serialize_many, #serialize_possessions, #serialized_relation_value
Instance Method Details
#assignments ⇒ Object
85
86
87
88
89
|
# File 'lib/cli/entry_serializers.rb', line 85
def assignments
defined_or_na(object.values) do |values|
Kerbi::Utils::Misc.flatten_hash(values).count
end
end
|
#created_at ⇒ Object
97
98
99
100
101
102
103
|
# File 'lib/cli/entry_serializers.rb', line 97
def created_at
if object.created_at
Kerbi::Utils::Misc.pretty_time_elapsed(object.created_at)
else
"N/A"
end
end
|
#message ⇒ Object
81
82
83
|
# File 'lib/cli/entry_serializers.rb', line 81
def message
(object.message || "").truncate(27)
end
|
#overrides ⇒ Object
91
92
93
94
95
|
# File 'lib/cli/entry_serializers.rb', line 91
def overrides
defined_or_na(object.overrides_delta) do |differences|
Kerbi::Utils::Misc.flatten_hash(differences).count
end
end
|
#tag ⇒ Object
77
78
79
|
# File 'lib/cli/entry_serializers.rb', line 77
def tag
colored_tag
end
|