154 |
my ( $before, $title, $after ) = ( '', '', '' ); |
my ( $before, $title, $after ) = ( '', '', '' ); |
155 |
( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->is_required; |
( $before, $title, $after ) = ( '<b>', ' title="required"', '</b>' ) if $attr->is_required; |
156 |
warn $attr->dump(3); |
warn $attr->dump(3); |
157 |
foreach my $check ( qw/has_type_constraint has_handles is_weak_ref is_required is_lazy should_coerce should_auto_deref has_trigger has_documentation has_applied_traits/ ) { |
foreach my $check ( qw/has_type_constraint has_handles is_weak_ref is_required is_lazy should_coerce should_auto_deref has_default has_trigger has_documentation has_applied_traits/ ) { |
158 |
my $getter; |
my $getter; |
159 |
|
|
160 |
$getter = $check; |
$getter = $check; |
165 |
$after .= "$check"; |
$after .= "$check"; |
166 |
} else { |
} else { |
167 |
$after .= qq{<span class="frey-popdown">$check}; |
$after .= qq{<span class="frey-popdown">$check}; |
168 |
$after .= '<code>' . $attr->$getter->dump . '</code>' if $getter ne $check; |
# we need dump here instead of $attr->$getter->dump because default can return scalar |
169 |
|
$after .= '<code>' . dump( $attr->$getter ) . '</code>' if $getter ne $check; |
170 |
$after .= '</span>'; |
$after .= '</span>'; |
171 |
} |
} |
172 |
} |
} |
173 |
$after .= ' '; |
$after .= ' '; |
174 |
} |
} |
175 |
qq|<td class="a">$before $_</td><td>$after</td>| |
my $type = $attr->has_type_constraint ? $attr->type_constraint->name : ''; |
176 |
|
qq|<td class="a">$before $_</td><td class="t">$type</td><td>$after</td>| |
177 |
} sort $meta->get_attribute_list |
} sort $meta->get_attribute_list |
178 |
} |
} |
179 |
|
|
180 |
my $table = qq|<table class="frey-object-browser"><tr><th class="m">Methods</th><th class="a">Attributes</th><th class="p">Properties</th></tr>|; |
my $table = qq|<table class="frey-object-browser"><tr><th class="m">Methods</th><th class="a">Attributes</th><th>Type</th><th class="p">Properties</th></tr>|; |
181 |
while ( @methods || @attributes ) { |
while ( @methods || @attributes ) { |
182 |
my ($m,$a) = ( shift @methods, shift @attributes ); |
my ($m,$a) = ( shift @methods, shift @attributes ); |
183 |
$m ||= '<td></td>'; |
$m ||= '<td></td>'; |