-
-
02 Jun 2017 00:03:17 UTC
- Distribution: File-DataClass
- Module version: v0.73.1
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (1)
- Testers (831 / 77 / 0)
- Kwalitee
Bus factor: 0- 95.64% Coverage
- License: perl_5
- Perl: v5.10.1
- Activity
24 month- Tools
- Download (72.28KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Cache::FastMmap
- Class::Null
- File::Path
- File::ReadBackwards
- Hash::Merge
- JSON::MaybeXS
- Module::Pluggable
- Module::Runtime
- Moo
- Sub::Install
- Subclass::Of
- Try::Tiny
- Type::Tiny
- Unexpected
- boolean
- namespace::autoclean
- namespace::clean
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- Name
- Synopsis
- Description
- Configuration and Environment
- Subroutines/Methods
- Diagnostics
- Dependencies
- Incompatibilities
- Bugs and Limitations
- Author
- License and Copyright
Name
File::DataClass::ResultSource - A source of result sets for a given schema
Synopsis
use File::DataClass::Schema; $schema = File::DataClass::Schema->new ( path => [ qw(path to a file) ], result_source_attributes => { source_name => {}, }, tempdir => [ qw(path to a directory) ] ); $schema->source( q(source_name) )->attributes( [ qw(list of attr names) ] ); $rs = $schema->resultset( q(source_name) ); $result = $rs->find( { name => q(id of field element to find) } ); $result->$attr_name( $some_new_value ); $result->update; @result = $rs->search( { 'attr name' => q(some value) } );
Description
Provides new result sources for a given schema
Each element in a data file requires a schema definition to define it's attributes
Configuration and Environment
Defines the following attributes
- attributes
-
Array reference of attribute names defined in this result source
- defaults
-
A hash reference of attribute names. The values are the defaults for the result class attributes
- name
-
The name of the result source. Required
- label_attr
-
An attribute name which, if set, is used by the list class to return a list of labels suitable for display purposes
- resultset_attributes
-
A hash reference passed to the result constructor
- resultset_class
-
Classname of the result set
- schema
-
A required weak reference to the schema object that is instantiating this result source
- types
-
A hash reference, keyed by attribute name. The types of the attributes in the result class
Subroutines/Methods
columns
@attributes = $self->columns;
Returns a list of attributes
has_column
$bool = $self->has_column( $attribute_name );
Predicate return true if the attribute exists, false otherwise
resultset
$rs = $self->resultset;
Creates and returns a new File::DataClass::ResultSet object
Diagnostics
None
Dependencies
Incompatibilities
There are no known incompatibilities in this module
Bugs and Limitations
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Author
Peter Flanigan,
<pjfl@cpan.org>
License and Copyright
Copyright (c) 2017 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
Module Install Instructions
To install File::DataClass, copy and paste the appropriate command in to your terminal.
cpanm File::DataClass
perl -MCPAN -e shell install File::DataClass
For more information on module installation, please visit the detailed CPAN module installation guide.