Skip to content

Instantly share code, notes, and snippets.

@robinsmidsrod
Created August 7, 2009 17:32
Show Gist options
  • Save robinsmidsrod/164043 to your computer and use it in GitHub Desktop.
Save robinsmidsrod/164043 to your computer and use it in GitHub Desktop.
package IMS::LOM::LangString;
use Moose;
with 'IMS::Include::XMLNode';
with 'IMS::Include::XPathContext';
with 'IMS::Include::findvalue';
use IMS::Include::Attribute::XPathValue;
has 'language' => (
is => 'ro',
isa => 'Str',
traits => [qw/XPathValue/],
xpath_query => './lom:langstring/@xml:lang',
# lazy_build => 1,
);
#sub _build_language {
# my ( $self ) = @_;
# return $self->findvalue( './lom:langstring/@xml:lang' );
#}
############################ other file ##########################
package IMS::Include::Attribute::XPathValue;
use Moose::Role;
has 'xpath_query' => (
is => 'ro',
isa => 'Str',
required => 1,
);
package Moose::Meta::Attribute::Custom::Trait::XPathValue;
sub register_implementation { 'IMS::Include::Attribute::XPathValue' }
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment