The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Rope::Conditional - Rope conditional properties

VERSION

Version 0.41

SYNOPSIS

package Why::Not;

use Rope;
use Rope::Autoload;
use Rope::Conditional;

conditional data => (
	"not" => {
		"for" => {
			"key" => "why",
			"keys" => 1,
			"if" => {
				"m" => "test",
				"key" => "test",
				"then" => {
					"one" => 123
				}
			},
			"elsif" => {
				"m" => "other",
				"key" => "test",
				"then" => {
					"two" => 456
				}
			},
			"else" => {
				"then" => {
					"three" => 789
				}
			}
		},
		"four" => 123
	}
);

conditional json_data => ['JSON', 'path/to/file.json'];
conditional yaml_data => ['YAML', 'path/to/file.yaml'];

...

1;

...

	my $k = Why::Not->new();

	say $k->data({
		why => { 
			a => { test => "other" },
			b => { test => "test" },
			c => { test => "other" },
			d => { test => "thing" },
		}
	}); 

	# not => {
        #	a => { two => 456 },
        #	b => { one => 123 },
        #	c => { two => 456 },
        #	d => { three => 789 },
       	#	def => 123
        # }

DESCRIPTION

Rope::Conditional extends rope with a conditional keyword which can be used to generate dynamic data based upon the passed in parameters, yes you could do all of this directly via a sub, but you only live once, right?

see Struct::Conditional for more information on the supported struct

AUTHOR

LNATION, <email at lnation.org>

BUGS

Please report any bugs or feature requests to bug-rope at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rope. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Rope

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2023 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)