| 1 | package Faker::Plugin::LoremSentences; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use 5.018; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | use Venus::Class 'base'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 2 | base 'Faker::Plugin'; | |||||||||||
| 11 | |||||||||||||
| 12 | # VERSION | ||||||||||||
| 13 | |||||||||||||
| 14 | 2 | our $VERSION = '1.19'; | |||||||||||
| 15 | |||||||||||||
| 16 | # METHODS | ||||||||||||
| 17 | |||||||||||||
| 18 | 6 | ▶ | sub execute { | ||||||||||
|
Subroutine
execute: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||
| 19 | 6 | my ($self, $data) = @_; | |||||||||||
| 20 | |||||||||||||
| 21 | 6 | ▶ | my $count = $data->{count} //= 5; | ||||||||||
|
Condition50%1/2
$data->{"count"} //= 5
MC/DC0%0/1
$data->{"count"} //= 5
$data->{"count"}
Truth table50%1/2
A
A= $data->{"count"}
| |||||||||||||
| 22 | |||||||||||||
| 23 | 6 | return join ' ', map | |||||||||||
| 24 | +(join ' ', map $self->faker->random->select(data_for_lorem_word()), | ||||||||||||
| 25 | 1..$self->faker->random->range(6, 20)), 1..$count; | ||||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | 412 | ▶ | sub data_for_lorem_word { | ||||||||||
|
Subroutine
data_for_lorem_word: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 29 | 412 | state $lorem_word = [ | |||||||||||
| 30 | 'alias', | ||||||||||||
| 31 | 'consequatur', | ||||||||||||
| 32 | 'aut', | ||||||||||||
| 33 | 'perferendis', | ||||||||||||
| 34 | 'sit', | ||||||||||||
| 35 | 'voluptatem', | ||||||||||||
| 36 | 'accusantium', | ||||||||||||
| 37 | 'doloremque', | ||||||||||||
| 38 | 'aperiam', | ||||||||||||
| 39 | 'eaque', | ||||||||||||
| 40 | 'ipsa', | ||||||||||||
| 41 | 'quae', | ||||||||||||
| 42 | 'ab', | ||||||||||||
| 43 | 'illo', | ||||||||||||
| 44 | 'inventore', | ||||||||||||
| 45 | 'veritatis', | ||||||||||||
| 46 | 'et', | ||||||||||||
| 47 | 'quasi', | ||||||||||||
| 48 | 'architecto', | ||||||||||||
| 49 | 'beatae', | ||||||||||||
| 50 | 'vitae', | ||||||||||||
| 51 | 'dicta', | ||||||||||||
| 52 | 'sunt', | ||||||||||||
| 53 | 'explicabo', | ||||||||||||
| 54 | 'aspernatur', | ||||||||||||
| 55 | 'aut', | ||||||||||||
| 56 | 'odit', | ||||||||||||
| 57 | 'aut', | ||||||||||||
| 58 | 'fugit', | ||||||||||||
| 59 | 'sed', | ||||||||||||
| 60 | 'quia', | ||||||||||||
| 61 | 'consequuntur', | ||||||||||||
| 62 | 'magni', | ||||||||||||
| 63 | 'dolores', | ||||||||||||
| 64 | 'eos', | ||||||||||||
| 65 | 'qui', | ||||||||||||
| 66 | 'ratione', | ||||||||||||
| 67 | 'voluptatem', | ||||||||||||
| 68 | 'sequi', | ||||||||||||
| 69 | 'nesciunt', | ||||||||||||
| 70 | 'neque', | ||||||||||||
| 71 | 'dolorem', | ||||||||||||
| 72 | 'ipsum', | ||||||||||||
| 73 | 'quia', | ||||||||||||
| 74 | 'dolor', | ||||||||||||
| 75 | 'sit', | ||||||||||||
| 76 | 'amet', | ||||||||||||
| 77 | 'consectetur', | ||||||||||||
| 78 | 'adipisci', | ||||||||||||
| 79 | 'velit', | ||||||||||||
| 80 | 'sed', | ||||||||||||
| 81 | 'quia', | ||||||||||||
| 82 | 'non', | ||||||||||||
| 83 | 'numquam', | ||||||||||||
| 84 | 'eius', | ||||||||||||
| 85 | 'modi', | ||||||||||||
| 86 | 'tempora', | ||||||||||||
| 87 | 'incidunt', | ||||||||||||
| 88 | 'ut', | ||||||||||||
| 89 | 'labore', | ||||||||||||
| 90 | 'et', | ||||||||||||
| 91 | 'dolore', | ||||||||||||
| 92 | 'magnam', | ||||||||||||
| 93 | 'aliquam', | ||||||||||||
| 94 | 'quaerat', | ||||||||||||
| 95 | 'voluptatem', | ||||||||||||
| 96 | 'ut', | ||||||||||||
| 97 | 'enim', | ||||||||||||
| 98 | 'ad', | ||||||||||||
| 99 | 'minima', | ||||||||||||
| 100 | 'veniam', | ||||||||||||
| 101 | 'quis', | ||||||||||||
| 102 | 'nostrum', | ||||||||||||
| 103 | 'exercitationem', | ||||||||||||
| 104 | 'ullam', | ||||||||||||
| 105 | 'corporis', | ||||||||||||
| 106 | 'nemo', | ||||||||||||
| 107 | 'enim', | ||||||||||||
| 108 | 'ipsam', | ||||||||||||
| 109 | 'voluptatem', | ||||||||||||
| 110 | 'quia', | ||||||||||||
| 111 | 'voluptas', | ||||||||||||
| 112 | 'sit', | ||||||||||||
| 113 | 'suscipit', | ||||||||||||
| 114 | 'laboriosam', | ||||||||||||
| 115 | 'nisi', | ||||||||||||
| 116 | 'ut', | ||||||||||||
| 117 | 'aliquid', | ||||||||||||
| 118 | 'ex', | ||||||||||||
| 119 | 'ea', | ||||||||||||
| 120 | 'commodi', | ||||||||||||
| 121 | 'consequatur', | ||||||||||||
| 122 | 'quis', | ||||||||||||
| 123 | 'autem', | ||||||||||||
| 124 | 'vel', | ||||||||||||
| 125 | 'eum', | ||||||||||||
| 126 | 'iure', | ||||||||||||
| 127 | 'reprehenderit', | ||||||||||||
| 128 | 'qui', | ||||||||||||
| 129 | 'in', | ||||||||||||
| 130 | 'ea', | ||||||||||||
| 131 | 'voluptate', | ||||||||||||
| 132 | 'velit', | ||||||||||||
| 133 | 'esse', | ||||||||||||
| 134 | 'quam', | ||||||||||||
| 135 | 'nihil', | ||||||||||||
| 136 | 'molestiae', | ||||||||||||
| 137 | 'et', | ||||||||||||
| 138 | 'iusto', | ||||||||||||
| 139 | 'odio', | ||||||||||||
| 140 | 'dignissimos', | ||||||||||||
| 141 | 'ducimus', | ||||||||||||
| 142 | 'qui', | ||||||||||||
| 143 | 'blanditiis', | ||||||||||||
| 144 | 'praesentium', | ||||||||||||
| 145 | 'laudantium', | ||||||||||||
| 146 | 'totam', | ||||||||||||
| 147 | 'rem', | ||||||||||||
| 148 | 'voluptatum', | ||||||||||||
| 149 | 'deleniti', | ||||||||||||
| 150 | 'atque', | ||||||||||||
| 151 | 'corrupti', | ||||||||||||
| 152 | 'quos', | ||||||||||||
| 153 | 'dolores', | ||||||||||||
| 154 | 'et', | ||||||||||||
| 155 | 'quas', | ||||||||||||
| 156 | 'molestias', | ||||||||||||
| 157 | 'excepturi', | ||||||||||||
| 158 | 'sint', | ||||||||||||
| 159 | 'occaecati', | ||||||||||||
| 160 | 'cupiditate', | ||||||||||||
| 161 | 'non', | ||||||||||||
| 162 | 'provident', | ||||||||||||
| 163 | 'sed', | ||||||||||||
| 164 | 'ut', | ||||||||||||
| 165 | 'perspiciatis', | ||||||||||||
| 166 | 'unde', | ||||||||||||
| 167 | 'omnis', | ||||||||||||
| 168 | 'iste', | ||||||||||||
| 169 | 'natus', | ||||||||||||
| 170 | 'error', | ||||||||||||
| 171 | 'similique', | ||||||||||||
| 172 | 'sunt', | ||||||||||||
| 173 | 'in', | ||||||||||||
| 174 | 'culpa', | ||||||||||||
| 175 | 'qui', | ||||||||||||
| 176 | 'officia', | ||||||||||||
| 177 | 'deserunt', | ||||||||||||
| 178 | 'mollitia', | ||||||||||||
| 179 | 'animi', | ||||||||||||
| 180 | 'id', | ||||||||||||
| 181 | 'est', | ||||||||||||
| 182 | 'laborum', | ||||||||||||
| 183 | 'et', | ||||||||||||
| 184 | 'dolorum', | ||||||||||||
| 185 | 'fuga', | ||||||||||||
| 186 | 'et', | ||||||||||||
| 187 | 'harum', | ||||||||||||
| 188 | 'quidem', | ||||||||||||
| 189 | 'rerum', | ||||||||||||
| 190 | 'facilis', | ||||||||||||
| 191 | 'est', | ||||||||||||
| 192 | 'et', | ||||||||||||
| 193 | 'expedita', | ||||||||||||
| 194 | 'distinctio', | ||||||||||||
| 195 | 'nam', | ||||||||||||
| 196 | 'libero', | ||||||||||||
| 197 | 'tempore', | ||||||||||||
| 198 | 'cum', | ||||||||||||
| 199 | 'soluta', | ||||||||||||
| 200 | 'nobis', | ||||||||||||
| 201 | 'est', | ||||||||||||
| 202 | 'eligendi', | ||||||||||||
| 203 | 'optio', | ||||||||||||
| 204 | 'cumque', | ||||||||||||
| 205 | 'nihil', | ||||||||||||
| 206 | 'impedit', | ||||||||||||
| 207 | 'quo', | ||||||||||||
| 208 | 'porro', | ||||||||||||
| 209 | 'quisquam', | ||||||||||||
| 210 | 'est', | ||||||||||||
| 211 | 'qui', | ||||||||||||
| 212 | 'minus', | ||||||||||||
| 213 | 'id', | ||||||||||||
| 214 | 'quod', | ||||||||||||
| 215 | 'maxime', | ||||||||||||
| 216 | 'placeat', | ||||||||||||
| 217 | 'facere', | ||||||||||||
| 218 | 'possimus', | ||||||||||||
| 219 | 'omnis', | ||||||||||||
| 220 | 'voluptas', | ||||||||||||
| 221 | 'assumenda', | ||||||||||||
| 222 | 'est', | ||||||||||||
| 223 | 'omnis', | ||||||||||||
| 224 | 'dolor', | ||||||||||||
| 225 | 'repellendus', | ||||||||||||
| 226 | 'temporibus', | ||||||||||||
| 227 | 'autem', | ||||||||||||
| 228 | 'quibusdam', | ||||||||||||
| 229 | 'et', | ||||||||||||
| 230 | 'aut', | ||||||||||||
| 231 | 'consequatur', | ||||||||||||
| 232 | 'vel', | ||||||||||||
| 233 | 'illum', | ||||||||||||
| 234 | 'qui', | ||||||||||||
| 235 | 'dolorem', | ||||||||||||
| 236 | 'eum', | ||||||||||||
| 237 | 'fugiat', | ||||||||||||
| 238 | 'quo', | ||||||||||||
| 239 | 'voluptas', | ||||||||||||
| 240 | 'nulla', | ||||||||||||
| 241 | 'pariatur', | ||||||||||||
| 242 | 'at', | ||||||||||||
| 243 | 'vero', | ||||||||||||
| 244 | 'eos', | ||||||||||||
| 245 | 'et', | ||||||||||||
| 246 | 'accusamus', | ||||||||||||
| 247 | 'officiis', | ||||||||||||
| 248 | 'debitis', | ||||||||||||
| 249 | 'aut', | ||||||||||||
| 250 | 'rerum', | ||||||||||||
| 251 | 'necessitatibus', | ||||||||||||
| 252 | 'saepe', | ||||||||||||
| 253 | 'eveniet', | ||||||||||||
| 254 | 'ut', | ||||||||||||
| 255 | 'et', | ||||||||||||
| 256 | 'voluptates', | ||||||||||||
| 257 | 'repudiandae', | ||||||||||||
| 258 | 'sint', | ||||||||||||
| 259 | 'et', | ||||||||||||
| 260 | 'molestiae', | ||||||||||||
| 261 | 'non', | ||||||||||||
| 262 | 'recusandae', | ||||||||||||
| 263 | 'itaque', | ||||||||||||
| 264 | 'earum', | ||||||||||||
| 265 | 'rerum', | ||||||||||||
| 266 | 'hic', | ||||||||||||
| 267 | 'tenetur', | ||||||||||||
| 268 | 'a', | ||||||||||||
| 269 | 'sapiente', | ||||||||||||
| 270 | 'delectus', | ||||||||||||
| 271 | 'ut', | ||||||||||||
| 272 | 'aut', | ||||||||||||
| 273 | 'reiciendis', | ||||||||||||
| 274 | 'voluptatibus', | ||||||||||||
| 275 | 'maiores', | ||||||||||||
| 276 | 'doloribus', | ||||||||||||
| 277 | 'asperiores', | ||||||||||||
| 278 | 'repellat', | ||||||||||||
| 279 | ] | ||||||||||||
| 280 | } | ||||||||||||
| 281 | |||||||||||||
| 282 | 2 | 1; | |||||||||||
| 283 | |||||||||||||
| 284 | |||||||||||||
| 285 | |||||||||||||
| 286 | =head1 NAME | ||||||||||||
| 287 | |||||||||||||
| 288 | Faker::Plugin::LoremSentences - Lorem Sentences | ||||||||||||
| 289 | |||||||||||||
| 290 | =cut | ||||||||||||
| 291 | |||||||||||||
| 292 | =head1 ABSTRACT | ||||||||||||
| 293 | |||||||||||||
| 294 | Lorem Sentences for Faker | ||||||||||||
| 295 | |||||||||||||
| 296 | =cut | ||||||||||||
| 297 | |||||||||||||
| 298 | =head1 VERSION | ||||||||||||
| 299 | |||||||||||||
| 300 | 1.19 | ||||||||||||
| 301 | |||||||||||||
| 302 | =cut | ||||||||||||
| 303 | |||||||||||||
| 304 | =head1 SYNOPSIS | ||||||||||||
| 305 | |||||||||||||
| 306 | package main; | ||||||||||||
| 307 | |||||||||||||
| 308 | use Faker::Plugin::LoremSentences; | ||||||||||||
| 309 | |||||||||||||
| 310 | my $plugin = Faker::Plugin::LoremSentences->new; | ||||||||||||
| 311 | |||||||||||||
| 312 | # bless(..., "Faker::Plugin::LoremSentences") | ||||||||||||
| 313 | |||||||||||||
| 314 | =cut | ||||||||||||
| 315 | |||||||||||||
| 316 | =head1 DESCRIPTION | ||||||||||||
| 317 | |||||||||||||
| 318 | This package provides methods for generating fake data for lorem sentences. | ||||||||||||
| 319 | |||||||||||||
| 320 | =encoding utf8 | ||||||||||||
| 321 | |||||||||||||
| 322 | =cut | ||||||||||||
| 323 | |||||||||||||
| 324 | =head1 INHERITS | ||||||||||||
| 325 | |||||||||||||
| 326 | This package inherits behaviors from: | ||||||||||||
| 327 | |||||||||||||
| 328 | L<Faker::Plugin> | ||||||||||||
| 329 | |||||||||||||
| 330 | =cut | ||||||||||||
| 331 | |||||||||||||
| 332 | =head1 METHODS | ||||||||||||
| 333 | |||||||||||||
| 334 | This package provides the following methods: | ||||||||||||
| 335 | |||||||||||||
| 336 | =cut | ||||||||||||
| 337 | |||||||||||||
| 338 | =head2 execute | ||||||||||||
| 339 | |||||||||||||
| 340 | execute(HashRef $data) (Str) | ||||||||||||
| 341 | |||||||||||||
| 342 | The execute method returns a returns a random fake lorem sentences. | ||||||||||||
| 343 | |||||||||||||
| 344 | I<Since C<1.10>> | ||||||||||||
| 345 | |||||||||||||
| 346 | =over 4 | ||||||||||||
| 347 | |||||||||||||
| 348 | =item execute example 1 | ||||||||||||
| 349 | |||||||||||||
| 350 | package main; | ||||||||||||
| 351 | |||||||||||||
| 352 | use Faker::Plugin::LoremSentences; | ||||||||||||
| 353 | |||||||||||||
| 354 | my $plugin = Faker::Plugin::LoremSentences->new; | ||||||||||||
| 355 | |||||||||||||
| 356 | # bless(..., "Faker::Plugin::LoremSentences") | ||||||||||||
| 357 | |||||||||||||
| 358 | # my $result = lplugin $result->execute; | ||||||||||||
| 359 | |||||||||||||
| 360 | # "vero deleniti fugiat in accusantium animi c..."; | ||||||||||||
| 361 | |||||||||||||
| 362 | # my $result = lplugin $result->execute; | ||||||||||||
| 363 | |||||||||||||
| 364 | # "enim accusantium aliquid id reprehenderit c..."; | ||||||||||||
| 365 | |||||||||||||
| 366 | # my $result = lplugin $result->execute; | ||||||||||||
| 367 | |||||||||||||
| 368 | # "reprehenderit ut autem cumque ea sint dolor..."; | ||||||||||||
| 369 | |||||||||||||
| 370 | =back | ||||||||||||
| 371 | |||||||||||||
| 372 | =cut | ||||||||||||
| 373 | |||||||||||||
| 374 | =head2 new | ||||||||||||
| 375 | |||||||||||||
| 376 | new(HashRef $data) (Plugin) | ||||||||||||
| 377 | |||||||||||||
| 378 | The new method returns a new instance of the class. | ||||||||||||
| 379 | |||||||||||||
| 380 | I<Since C<1.10>> | ||||||||||||
| 381 | |||||||||||||
| 382 | =over 4 | ||||||||||||
| 383 | |||||||||||||
| 384 | =item new example 1 | ||||||||||||
| 385 | |||||||||||||
| 386 | package main; | ||||||||||||
| 387 | |||||||||||||
| 388 | use Faker::Plugin::LoremSentences; | ||||||||||||
| 389 | |||||||||||||
| 390 | my $plugin = Faker::Plugin::LoremSentences->new; | ||||||||||||
| 391 | |||||||||||||
| 392 | # bless(..., "Faker::Plugin::LoremSentences") | ||||||||||||
| 393 | |||||||||||||
| 394 | =back | ||||||||||||
| 395 | |||||||||||||
| 396 | =cut | ||||||||||||
| 397 | |||||||||||||
| 398 | =head1 AUTHORS | ||||||||||||
| 399 | |||||||||||||
| 400 | Awncorp, C<awncorp@cpan.org> | ||||||||||||
| 401 | |||||||||||||
| 402 | =cut | ||||||||||||
| 403 | |||||||||||||
| 404 | =head1 LICENSE | ||||||||||||
| 405 | |||||||||||||
| 406 | Copyright (C) 2000, Al Newkirk. | ||||||||||||
| 407 | |||||||||||||
| 408 | This program is free software, you can redistribute it and/or modify it under | ||||||||||||
| 409 | the terms of the Apache license version 2.0. | ||||||||||||
| 410 | |||||||||||||
| 411 | =cut | ||||||||||||