NAME
Chart::GGPlot::Params - Collection of key-value pairs used in Chart::GGPlot
VERSION
version 0.0000_01
DESCRIPTION
This class provides a duck typing interface similar as Data::Frame::Autobox::HashRef, and adds a mechanism to its derived classes to customize aliasing of hash keys by overriding the transform_key
classmethod.
CLASS METHODS
transform_key($key)
Derived classes can override this classmethod to have their own way of renaming the keys.
METHODS
exists($key)
Tests if a key exists.
keys()
Return an array ref of keys.
names()
This is an alias of the keys()
method.
values()
Return an array ref of values.
isempty()
delete($key)
set($key, $value)
Associate a value with a key and return the value.
at($key)
Get associated value of the given key.
flatten()
hslice($keys)
slice($keys)
This is an alias of hslice
.
kv()
Return a list of a value with a key and return the value.
merge
merge($other, $skip_undef=false)
Returns a new object with right precedence shallow merging. If $skip_undef
is true, kv with undef
value in $other
would be skipped.
my $merged = $params->merge($other);
defaults($other)
Using data from $other
as defaults. If $other
is undef
, returns a clone of $self
.
rename($href_or_coderef)
my $p2 = $p1->rename( { $from_key => $to_key, ... } );
Returns a new object.
as_hashref()
clone()
SEE ALSO
AUTHOR
Stephan Loyd <sloyd@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2018 by Stephan Loyd.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.