Class: ObjectInspector::TemplatingFormatter
Overview
ObjectInspector::TemplatingFormatter implements BaseFormatter to return the standard/default inspect output format via String templates.
Constant Summary
BaseFormatter::RIGHT_ARROW_ICON
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#flags, #identification, #info, #initialize, #name, #wrapped_object_inspection
Instance Attribute Details
Returns the current value of inspector.
7
8
9
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 7
def inspector
@inspector
end
|
Class Method Details
.base_template ⇒ Object
8
9
10
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 8
def self.base_template
@base_template ||= "<%s>".freeze
end
|
.flags_and_info_and_name_template ⇒ Object
28
29
30
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 28
def self.flags_and_info_and_name_template
@flags_and_info_and_name_template ||= "<%s(%s) %s :: %s>".freeze
end
|
.flags_and_info_template ⇒ Object
24
25
26
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 24
def self.flags_and_info_template
@flags_and_info_template ||= "<%s(%s) %s>".freeze
end
|
.flags_and_name_template ⇒ Object
16
17
18
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 16
def self.flags_and_name_template
@flags_and_name_template ||= "<%s(%s) :: %s>".freeze
end
|
.flags_template ⇒ Object
32
33
34
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 32
def self.flags_template
@flags_template ||= "<%s(%s)>".freeze
end
|
.info_and_name_template ⇒ Object
20
21
22
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 20
def self.info_and_name_template
@info_and_name_template ||= "<%s %s :: %s>".freeze
end
|
.info_template ⇒ Object
36
37
38
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 36
def self.info_template
@info_template ||= "<%s %s>".freeze
end
|
.name_template ⇒ Object
12
13
14
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 12
def self.name_template
@name_template ||= "<%s :: %s>".freeze
end
|
Instance Method Details
#call ⇒ String
Perform the formatting routine.
43
44
45
46
47
48
49
|
# File 'lib/object_inspector/formatters/templating_formatter.rb', line 43
def call
if wrapped_object_inspection
build_wrapped_object_string
else
build_string
end
end
|