view release on metacpan or search on metacpan
lib/Dallycot/Parser.pm view on Meta::CPAN
return bless [$expression] => 'Dallycot::AST::Defined';
}
##
# Eventually, Range will be a type representing all values between
# two endpoints.
#
# Q: how to indicate open/closed endpoints
#
# ( e1 .. e2 )
# [ e1 .. e2 )
# ( e1 .. e2 ]
# [ e1 .. e2 ]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Auth/Facebook.pm view on Meta::CPAN
The authenticated user information will be available as a hash reference under
C<session('fb_user')>. You should probably associate the C<id> field to that
user, so you know which of your users just completed the login.
The information under C<fb_user> is returned by the current user's basic
endpoint, known on Facebook's API as C</me>. You should note that Facebook
has a habit of changing which fields are returned on that endpoint. To force
any particular fields, please use the C<fields> setting in your plugin
configuration as shown below.
Please refer to L<< Facebook's documentation | https://developers.facebook.com/docs/graph-api/reference/v4.0/user >>
for all available data.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Auth/Google.pm view on Meta::CPAN
=head4 NOTE: G+ is no more. Add 'legacy_gplus: 1' to keep old code running.
Up to version 0.06 of this module the C<< session('google_user') >>
data structure was as returned by Google Plus' API. Google decided to
discontinue G+ and its API on March 7th 2019, so since version 0.07
we fetch user information from Google's C<oauth2/v2/userinfo> endpoint.
Those two structures are very different, so
B<you will need to update your code> if you used any version of this module
prior to 0.07. If you don't want to, add the C<legacy_gplus> option to
your configuration with a true value and C<< session('google_user') >>
view all matches for this distribution
view release on metacpan or search on metacpan
t/application.t view on Meta::CPAN
get '/perl' => sub { fb->fetch ('16665510298')->{name} };
setup_fb;
1;
}
route_exists [GET => '/perl'], "GET /perl endpoint exists";
route_doesnt_exist [GET => '/auth/facebook'], "GET /auth/facebook endpoint does not exist";
route_doesnt_exist [GET => '/auth/facebook/postback'], "GET /auth/facebook/postback endpoint does not exist";
my $response = dancer_response GET => '/perl';
debug "Response is ", $response;
is $response->status, 200, "GET /perl succeeded";
like $response->content, qr,perl,, "GET /perl produced expected output";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/RESTModel.pm view on Meta::CPAN
Dancer::Plugin::RESTModel - REST model class for Dancer apps
=head1 SYNOPSIS
set the REST endpoint in your Dancer configuration file:
plugins:
RESTModel:
MyData:
server: http://localhost:5000
view all matches for this distribution
view release on metacpan or search on metacpan
example/lib/Example.pm view on Meta::CPAN
arguments => ['Example::API::System'],
},
);
my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
for my $plugin (@plugins) {
$system_config->register_endpoint($plugin, '/system');
}
}
{
my $db_config = Example::EndpointConfig->new(
example/lib/Example.pm view on Meta::CPAN
bread_board => $db_api,
);
my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
for my $plugin (@plugins) {
for my $path (keys %{ config->{plugins}{$plugin} }) {
$db_config->register_endpoint($plugin, $path);
}
}
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
example/lib/Client/MetaCpan.pm view on Meta::CPAN
my ($query) = @_;
$query =~ s{::}{-}g;
my $params = $http->www_form_urlencode("q=$query");
(my $endpoint = $self->base_uri->as_string) =~ s{/+$}{};
my $response = $self->client->get("$endpoint/?$params");
my $content = eval { decode_json($response->{content}) };
return $content if !$@;
return { error => $@, data => $response->{content} };
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer/Plugin/Resource.pm view on Meta::CPAN
$params = ":${singular_resource}_id";
}
my ($package) = caller;
# main resource endpoints
# CRUD
_post(
_endpoint(
path => $plural_resource,
params => '',
verbs => [qw/POST create/],
function => $singular_resource
)
);
_get(
_endpoint(
path => $plural_resource,
params => $params,
verbs => [qw/GET get read/],
loader => $options{load},
function => $singular_resource
)
);
_put(
_endpoint(
path => $plural_resource,
params => $params,
verbs => [qw/PUT update/],
loader => $options{load},
function => $singular_resource
)
);
_del(
_endpoint(
path => $plural_resource,
params => $params,
verbs => [qw/DELETE delete/],
loader => $options{load},
function => $singular_resource
)
);
_get(
_endpoint(
path => $plural_resource,
params => '',
verbs => [qw/INDEX index/],
loader => $options{load_all},
function => $singular_resource
lib/Dancer/Plugin/Resource.pm view on Meta::CPAN
for my $member (@{$options{member}}) {
my $path = "${plural_resource}/$params/${member}";
my $member_param = "";
_post(
_endpoint(
path => $path,
params => '',
verbs => [qw/POST create/],
loader => $options{load},
function => "${singular_resource}_${member}"
)
);
_get(
_endpoint(
path => $path,
params => $member_param,
verbs => [qw/GET get read/],
loader => $options{load},
function => "${singular_resource}_${member}"
)
);
_put(
_endpoint(
path => $path,
params => $member_param,
verbs => [qw/PUT update/],
loader => $options{load},
function => "${singular_resource}_${member}"
)
);
_del(
_endpoint(
path => $path,
params => $member_param,
verbs => [qw/DELETE delete/],
loader => $options{load},
function => "${singular_resource}_${member}"
lib/Dancer/Plugin/Resource.pm view on Meta::CPAN
# collection routes are actions on the collection. ie /users/foo
for my $collection (@{$options{collection}}) {
my $path = "${plural_resource}/${collection}";
_post(
_endpoint(
path => $path,
params => '',
verbs => [qw/POST create/],
loader => $options{load_all},
function => "${plural_resource}_${collection}"
)
);
_get(
_endpoint(
path => $path,
params => '',
verbs => [qw/GET get read/],
loader => $options{load_all},
function => "${plural_resource}_${collection}"
)
);
_put(
_endpoint(
path => $path,
params => '',
verbs => [qw/PUT update/],
loader => $options{load_all},
function => "${plural_resource}_${collection}"
)
);
_del(
_endpoint(
path => $path,
params => '',
verbs => [qw/DELETE delete/],
loader => $options{load_all},
function => "${plural_resource}_${collection}"
lib/Dancer/Plugin/Resource.pm view on Meta::CPAN
_debug("=> DEL " .(Dancer::App->current->prefix||'').$_."\n");
del($_ => $sub);
}
}
sub _endpoint {
my %opts = @_;
my ($function, $word, $params, $verbs, $load_func) = @opts{qw/function path params verbs loader/};
my $package = caller(1);
view all matches for this distribution
view release on metacpan or search on metacpan
t/documents/timetable.yapce2016.ics view on Meta::CPAN
ATTENDEE:Juan Camacho
ATTENDEE:Mark Stringer
ATTENDEE:Virgil Dinu
ATTENDEE:José JoaquÃn Atria
COMMENT:47 attendees
DESCRIPTION:A dissection of a rather simple API endpoint.\n\nSome likely to
pics:\n- NoFramework is the new NoSQL\n- Fat Models\n- Bearer Tokens\, JWT
s & true stateless APIs\n- Postgres Common Table Expressions and window fu
nctions
DTEND;TZID=Europe/Bucharest:20160824T170500
DTSTART;TZID=Europe/Bucharest:20160824T163500
LOCATION:Amfiteatrul Mircea Dorofteiu\, 1st floor
ORGANIZER:Thomas Klausner
SUMMARY:How to write an API endpoint in 2016
UID:http://act.yapc.eu/ye2016/talk/6714
URL:http://act.yapc.eu/ye2016/talk/6714
END:VEVENT
BEGIN:VEVENT
ATTENDEE:Jean Forget
t/documents/timetable.yapce2016.ics view on Meta::CPAN
ATTENDEE:Virgil Dinu
ATTENDEE:José JoaquÃn Atria
COMMENT:40 attendees
DESCRIPTION:Swagger is a specification of a REST API.\nIt is now the base o
f the Open API Initiative supported by a number of companies\n\nWhat *you*
have to do:\n* Understand the spec and specify all your API endpoints (pa
rameters\, input and output schema)\n* Each item of the spec can have a "d
escription"\n\nWhat does it give you in return:\n* The spec and your descr
iptions are the public documentation - no need to seperately administrate
docs that possibly get out of date\n* A nice javascript frontend for manua
l testing\, with OAuth2 support\n* A plugin for your web framework (*)\, w
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-base.t view on Meta::CPAN
use Dancer2::Plugin::Github::Webhook;
set serializer => 'JSON';
post '/' => require_github_webhook_secret sub { [1] };
post '/a' => require_github_webhook_secret config->{'github-webhooks'}->{endpoint_a} => sub { [1] };
post '/b' => require_github_webhook_secret config->{'github-webhooks'}->{endpoint_b} => sub { [1] };
post '/c' => require_github_webhook_secret 'anotherverysecretsecret' => sub { [1] };
}
my $app = MyTestApp->to_app;
t/01-base.t view on Meta::CPAN
is $res->code, 200, 'Correct signature is accepted';
ok JSON::from_json( $res->content )->[0] eq '1', 'Correct signature is accepted';
}
{
# correct signature, other endpoint
my $content = JSON::to_json( { some => 'other', content => [qw/here in this array/] } );
require Digest::SHA;
my $signature = 'sha1=' . Digest::SHA::hmac_sha1_hex( $content, 'sk78fozuhv3efgv' );
my $req = HTTP::Request->new( POST => '/a' => [ 'X-Hub-Signature' => $signature ], $content );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/GraphQL.pm view on Meta::CPAN
};
=head1 DESCRIPTION
The C<graphql> keyword which is exported by this plugin allow you to
define a route handler implementing a GraphQL endpoint.
Parameters, after the route pattern.
The first three can be replaced with a single array-ref. If so,
the first element is a classname-part, which will be prepended with
"L<GraphQL::Plugin::Convert>::". The other values will be passed to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/Menu.pm view on Meta::CPAN
=head2 KEYWORDS
=head3 menu_item( { [title => $str], [weight => $num] }, C<ROUTE METHOD> C<REGEXP>, C<CODE>)
Wraps a conventional route handler preceded by a required hash reference
containing data that will be applied to the route's endpoint.
Two keys can be supplied in the hash reference: a C<title> for the menu item and
a C<weight>. The C<title> will be used as the content for the menu items. The
C<weight> will determine the order of the menu items. Heavier items (with larger
values) will "sink" to the bottom compared to sibling menu items. If two sibling
menu items have the same weight, the menu items will be ordered alphabetically.
Menu items that are not endpoints in the route or that don't have a C<title>,
will automatically generate a title according to the path segment's name. For
example, the route C</categories/fun food/desserts> is converted to a hierarchy
of menu items entitled C<Categories>, C<Fun food>, and C<Desserts>. Note that
capitalization is automatically added. Automatic titles will be overridden with
endpoint specific titles if they are supplied in a later C<menu_item> call.
If the C<weight> is not supplied it will default to a value of C<5>.
=head1 CONFIGURATION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Plugin/PrometheusTiny.pm view on Meta::CPAN
};
}
# CONFIG
has endpoint => (
is => 'ro',
isa => Str,
from_config => sub {'/metrics'},
);
lib/Dancer2/Plugin/PrometheusTiny.pm view on Meta::CPAN
);
}
$app->add_route(
method => 'get',
regexp => $plugin->endpoint,
code => sub {
my $app = shift;
$plugin->execute_plugin_hook(
'before_format', $app,
$prometheus
lib/Dancer2/Plugin/PrometheusTiny.pm view on Meta::CPAN
=head1 DESCRIPTION
This plugin integrates L<Prometheus::Tiny::Shared> with your L<Dancer2> app,
providing some default metrics for requests and responses, with the ability
to easily add further metrics to your app. A route is added which makes
the metrics available via the configured L</endpoint>.
See L<Prometheus::Tiny> for more details of the kind of metrics supported.
The following metrics are included by default:
lib/Dancer2/Plugin/PrometheusTiny.pm view on Meta::CPAN
Example:
plugins:
PrometheusTiny:
endpoint: /prometheus-metrics # default: /metrics
filename: /run/d2prometheus # default: (undef)
include_default_metrics: 0 # default: 1
metrics: # default: {}
http_request_count:
help: HTTP Request count
type: counter
See below for full details of each configuration setting.
=head2 endpoint
The endpoint from which metrics are served. Defaults to C</metrics>.
=head2 filename
It is recommended that this is set to a directory on a memory-backed
filesystem. See L<Prometheus::Tiny::Shared/filename> for details and default
view all matches for this distribution
view release on metacpan or search on metacpan
example/lib/Example.pm view on Meta::CPAN
arguments => ['Example::API::System'],
},
);
my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
for my $plugin (@plugins) {
$system_config->register_endpoint($plugin, '/system');
}
}
{
my $db_config = Example::EndpointConfig->new(
example/lib/Example.pm view on Meta::CPAN
}
);
my @plugins = grep { /^RPC::/ } keys %{ config->{plugins} };
for my $plugin (@plugins) {
for my $path (keys %{ config->{plugins}{$plugin} }) {
$db_config->register_endpoint($plugin, $path);
}
}
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
ex/MixedEndpoints.pm view on Meta::CPAN
use warnings;
use strict;
=head1 DESCRIPTION
Package with calls for diffent endpoints.
=head2 call_for_system
=for xmlrpc system.call call_for_system /system
ex/MixedEndpoints.pm view on Meta::CPAN
=for restrpc call call_for_system /system
=cut
sub call_for_system { return {endpoint => '/system'} }
=head2 call_for_testing
=for xmlrpc testing.call call_for_testing /testing
ex/MixedEndpoints.pm view on Meta::CPAN
=for restrpc call call_for_testing /testing
=cut
sub call_for_testing { return {endpoint => '/testing'} }
=head2 call_for_all_endpoints
=for xmlrpc any.call call_for_all_endpoints
=for jsonrpc any_call call_for_all_endpoints
=for restrpc any-call call_for_all_endpoints
=cut
sub call_for_all_endpoints { return {endpoint => '*'} }
1;
view all matches for this distribution
view release on metacpan or search on metacpan
example/app.pl view on Meta::CPAN
# That's it. Seriously, that's all you need.
# Below you'll see how to customize the behavior further by configuring one or
# more hooks that the SPID plugin will call.
# This hook is called when the login endpoint is called and the AuthnRequest
# is about to be crafted.
hook 'plugin.SPID.before_login' => sub {
# ...
};
example/app.pl view on Meta::CPAN
hook 'plugin.SPID.after_failed_login' => sub {
my $statuscode = shift;
info "SPID login failed: $statuscode";
};
# This hook is called when the logout endpoint is called and the LogoutRequest
#Â is about to be crafted.
hook 'plugin.SPID.before_logout' => sub {
debug "User " . spid_session->nameid . " is about to logout";
};
# This hook is called when a SPID session is terminated (this might be triggered
# also when user initiated logout from another Service Provider or directly
# within the Identity Provider, thus without calling our logout endpoint and
# the 'before_logout' hook).
hook 'plugin.SPID.after_logout' => sub {
my $success = shift; # 'success' or 'partial'
debug "User " . spid_session->nameid . " logged out";
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dancer2/Cookbook.pod view on Meta::CPAN
will be serialized and deserialized. This is how the feature works.
As suggested above, if you would like to have both, you need to create
another application which will not be serialized.
A common usage for this is an API providing serialized endpoints (and
receiving serialized requests) and providing rendered pages.
# MyApp.pm
package MyApp;
use Dancer2;
view all matches for this distribution
view release on metacpan or search on metacpan
share/assets/dash_core_components/async~plotlyjs.js view on Meta::CPAN
(window.webpackJsonpdash_core_components=window.webpackJsonpdash_core_components||[]).push([[5],{685:function(t,e){!function(r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define([],r):("undefined"!=typeof windo...
view all matches for this distribution
view release on metacpan or search on metacpan
examples/simple_flex_rpc/SimpleFlexRPC.mxml view on Meta::CPAN
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
>
<fx:Declarations>
<s:RemoteObject id="helloService"
endpoint="http://localhost:5000/amf/gateway"
destination="perlamf"
source="HelloController"
showBusyCursor="true"
result="log(event.result);"
fault="log(event.fault.faultDetail)"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/AnyXfer/Elastic/Index.pm view on Meta::CPAN
sub suggest {
my ( $self, %args ) = @_;
# perform the suggestions search as part of a
# normal search now that the suggest endpoint has been removed
my $results = $self->search( #
%args, body => { suggest => $args{body} }
);
return $results->{suggest};
view all matches for this distribution
view release on metacpan or search on metacpan
t/01boolfield.t view on Meta::CPAN
is_deeply( { unpack_BYTES( "\x05" ) }, { first => 1, second => !1, third => 1 },
'unpack_BYTES' );
}
# endpoints
{
bitfield { format => "bytes-LE" }, U32L =>
high => boolfield(31),
low => boolfield(0);
view all matches for this distribution
view release on metacpan or search on metacpan
sample/formats/sample.yml view on Meta::CPAN
# ================================================================
# Hybrid Cloud Information.
# ================================================================
hybrid:
# The Keystone Identity service endpoint host. Enter either the host FQDN or
# it's IP address. This value is not validated. Please ensure it is correct.
# The value is defaulted to 192.168.101.10 for the ICOS Hybrid cloud.
keystone_endpoint_host: 192.168.101.10
# The Identity service admin tenant name. The value is defaulted to
# on-prem-admin for the ICOS Hybrid cloud.
admin_tenant_name: on-prem-admin
# The Identity service admin user name. The value is defaulted to
# admin-on-prem for the ICOS Hybrid cloud.
view all matches for this distribution
view release on metacpan or search on metacpan
msgpack-3.3.0/example/boost/asio_send_recv.cpp view on Meta::CPAN
boost::asio::io_service ios;
std::uint16_t const port = 12345;
// Server
std::size_t const window_size = 10;
boost::asio::ip::tcp::acceptor ac(ios, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port));
boost::asio::ip::tcp::socket ss(ios);
std::function<void()> do_accept;
std::function<void()> do_async_read_some;
msgpack::unpacker unp;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Password/zxcvbn/RankedDictionaries/English.pm view on Meta::CPAN
'endothelial' => 14677,
'endow' => 27227,
'endowed' => 7483,
'endowment' => 5819,
'endowments' => 15728,
'endpoint' => 17164,
'endpoints' => 18628,
'endurance' => 6038,
'endured' => 8359,
'endures' => 24936,
'enduring' => 6682,
'enduro' => 27036,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Random/dict view on Meta::CPAN
endowed
endowing
endowment
endowments
endows
endpoint
ends
endurable
endurably
endurance
endure
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/api.pm view on Meta::CPAN
$forker->put( '174' );
$forker->expect( '175' );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.05695|1568050706.05696 0`29`0',47 );
$forker->put( '176' );
$forker->expect( '177' );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.06095|1568050706.06097 0`29`1`ENDPOINT`vlocalhost/app-endpoint',81 );
$forker->put( '178' );
$forker->expect( '179' );
$provider->stow( 'Yote|1568050706.03146|1568050706.06187 domains`r6`root_dir`v/opt/yote/`config`r57',4 );
$forker->put( '180' );
$forker->expect( '181' );
t/lib/api.pm view on Meta::CPAN
$forker->put( '141' );
$forker->expect( '142' );
$provider->stow( 'Yote::App::PageCounter|1568050706.05239|1568050706.05493 _session_pool`r16`_app_path`vpageCounter2`_methods_access_levels`r12`_site`vlocalhost`_domain`r7`_session`r14`_login`r20`_resets`r18`_email`r22',11 );
$forker->put( '143' );
$forker->expect( '144' );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.0606|1568050706.06062 0`29`1`ENDPOINT`vlocalhost/app-endpoint',78 );
$forker->put( '145' );
$forker->expect( '146' );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.05706|1568050706.05711 0`29`3`update_counter`v1`fetch`v1`update`v1',48 );
$forker->put( '147' );
$forker->expect( '148' );
t/lib/api.pm view on Meta::CPAN
$provider->stow( 'Data::ObjectStore::Hash|1568050706.26025|1568050706.26051 0`29`1`PUBLIC`r98',97 );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.05742|1568050706.25844 0`29`3`update_counter`v1`fetch`v1`update`v1',51 );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.25923|1568050706.26156 0`29`1`localhost`r93',92 );
$provider->stow( 'Yote|1568050706.03146|1568050706.2621 domains`r6`root_dir`v/opt/yote/`config`r91',4 );
$provider->stow( 'Data::ObjectStore::Array|1568050706.26045|1568050706.2605 0`1000000`3`0`vupdate_counter`vupdate`vfetch',98 );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.26153|1568050706.26155 0`29`1`ENDPOINT`vlocalhost/app-endpoint',103 );
$provider->stow( 'Data::ObjectStore::Hash|1568050706.26108|1568050706.2613 0`29`1`PUBLIC`r102',101 );
$provider->stow( 'Data::ObjectStore::Container|1568050706.0199|1568050706.27449 db_version`v5.03`created_time`v1568050706.0199`last_update_time`v1568050706.26213`root`r2`ObjectStore_version`v2.10',1 );
$provider->commit_transaction( );
$provider->fetch( 39 );
$provider->lock( 'Yote::App::SESSION' );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Riak.pm view on Meta::CPAN
=head2 status
Attempts to retrieve information about the performance and configuration of the
Riak node. Returns a hash reference containing the data provided by the
C</stats> endpoint of the Riak node or throws an exception if the status
information could not be retrieved.
=head2 _buckets
Get the list of buckets. This is NOT RECOMMENDED for production systems, as Riak
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Seek.pm view on Meta::CPAN
values, or as a hash object in the same shape as the original.
=head1 ENCODING
During the processing of flattening a data structure with nested data, the
following data structure would be converted into a collection of endpoint/value
pairs.
{
'id' => 12345,
'patient' => {
lib/Data/Seek.pm view on Meta::CPAN
}],
}]
}
Given the aforementioned data structure, the following would be the resulting
flattened structure comprised of endpoint/value pairs.
{
'id' => 12345,
'medications:0.aceInhibitors:0.dose' => '1 tab',
'medications:0.aceInhibitors:0.name' => 'lisinopril',
lib/Data/Seek.pm view on Meta::CPAN
'medications:0.antianginal:0.strength' => '0.4 mg Sublingual Tab',
'patient.name.first' => 'Bob'
'patient.name.last' => 'Bee',
}
This structure provides the endpoint strings which will be matched against using
the querying strategy.
=head1 QUERYING
During the processing of querying the data structure, the criteria (query
expressions) are converted into a series of regular expressions to be applied
sequentially, filtering/reducing the endpoints and producing a data set of
matching nodes or throwing an exception explaining the search failure.
=over 4
=item * B<Node Expression>
lib/Data/Seek.pm view on Meta::CPAN
The follow is a short and simple overview of the strategy and syntax used by
Data::Seek to query complex data structures. The overall idea behind Data::Seek
is to flatten/fold the data structure, reduce it by applying a series patterns,
then, unflatten/unfold and operate on the new data structure. The introspection
strategy is to flatten the data structure producing a non-hierarchical data
structure where its keys represent endpoints (using dot-notation and colons to
separate (and denote) nested hash keys and array indices respectively) within
the structure.
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/SplitSerializer.pm view on Meta::CPAN
my $prh = { $path => $ref }; # single row answer
return $prh if blessed $ref; # down that path leads madness...
my $type = ref $ref || return $prh; # that covers SCALARs...
return $prh unless $type =~ /HASH|ARRAY/; # ...and all other endpoints
# Blessed is the path
unless (blessed $path) {
$path = $self->path_style->new(
%{ $self->path_options },
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Transfigure.pm view on Meta::CPAN
=head1 DESCRIPTION
C<Data::Transfigure> allows you to write reusable rules ('transfigurators') to modify
parts (or all) of a data structure. There are many possible applications of this,
but it was primarily written to handle converting object graphs of ORM objects
into a structure that could be converted to JSON and delivered as an API endpoint
response. One of the challenges of such a system is being able to reuse code
because many different controllers could need to convert the an object type to
the same structure, but then other controllers might need to convert that same
type to a different structure.
view all matches for this distribution