--- branches/mojo/lib/Frey/Introspect.pm 2008/11/02 21:24:04 243
+++ branches/mojo/lib/Frey/Introspect.pm 2008/11/04 19:11:06 254
@@ -154,7 +154,7 @@
my ( $before, $title, $after ) = ( '', '', '' );
( $before, $title, $after ) = ( '', ' title="required"', '' ) if $attr->is_required;
warn $attr->dump(3);
- 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/ ) {
my $getter;
$getter = $check;
@@ -165,7 +165,8 @@
$after .= "$check";
} else {
$after .= qq{$check};
- $after .= '' . $attr->$getter->dump . '
' if $getter ne $check;
+ # we need dump here instead of $attr->$getter->dump because default can return scalar
+ $after .= '' . dump( $attr->$getter ) . '
' if $getter ne $check;
$after .= '';
}
}
@@ -214,7 +215,7 @@
my $pod = Frey::Pod->new( class => $class )->markup;
use Frey::Run;
- my $execute = join("\n", map { qq|$_| } grep { $class->can($_) } Frey::Run->execute );
+ my $execute = join("\n", map { qq|$_| } grep { $class->can($_) } Frey::Run->execute );
$execute = " execute: $execute" if $execute;
my $html = $self->page(