| 1 | |||||||||||||
| 2 | ### | ||||||||||||
| 3 | # CSS::SAC::Condition::Lang - SAC LangConditions | ||||||||||||
| 4 | # Robin Berjon <robin@knowscape.com> | ||||||||||||
| 5 | # 24/02/2001 | ||||||||||||
| 6 | ### | ||||||||||||
| 7 | |||||||||||||
| 8 | package CSS::SAC::Condition::Lang; | ||||||||||||
| 9 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 10 | 2 | ▶ | use vars qw($VERSION); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 11 | 2 | ▶ | $VERSION = $CSS::SAC::VERSION || '0.03'; | ||||||||||
|
Condition50%1/2
$CSS::SAC::VERSION || '0.03'
MC/DC0%0/1
$CSS::SAC::VERSION || '0.03'
$CSS::SAC::VERSION
Truth table50%1/2
A
A= $CSS::SAC::VERSION
| |||||||||||||
| 12 | |||||||||||||
| 13 | 2 | ▶ | use base qw(CSS::SAC::Condition); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | |||||||||||||
| 15 | |||||||||||||
| 16 | #---------------------------------------------------------------------# | ||||||||||||
| 17 | # build the fields for an array based object | ||||||||||||
| 18 | #---------------------------------------------------------------------# | ||||||||||||
| 19 | 2 | ▶ | use Class::ArrayObjects extend => { | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | class => 'CSS::SAC::Condition', | ||||||||||||
| 21 | with => [qw( | ||||||||||||
| 22 | _lang_ | ||||||||||||
| 23 | )], | ||||||||||||
| 24 | 2 | }; | |||||||||||
| 25 | #---------------------------------------------------------------------# | ||||||||||||
| 26 | |||||||||||||
| 27 | |||||||||||||
| 28 | |||||||||||||
| 29 | |||||||||||||
| 30 | ### Constructor ####################################################### | ||||||||||||
| 31 | # # | ||||||||||||
| 32 | # # | ||||||||||||
| 33 | |||||||||||||
| 34 | |||||||||||||
| 35 | #---------------------------------------------------------------------# | ||||||||||||
| 36 | # CSS::SAC::Condition::Lang->new($type,$lang) | ||||||||||||
| 37 | # creates a new sac LangCondition object | ||||||||||||
| 38 | #---------------------------------------------------------------------# | ||||||||||||
| 39 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=11.2
Pod
documented
| |||||||||||||
| 40 | 1 | ▶ | my $class = ref($_[0])?ref(shift):shift; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 41 | 1 | my $type = shift; # should be one of the content conditions | |||||||||||
| 42 | 1 | my $lang = shift; | |||||||||||
| 43 | |||||||||||||
| 44 | # create a condition | ||||||||||||
| 45 | 1 | my $ccond = $class->SUPER::new($type); | |||||||||||
| 46 | |||||||||||||
| 47 | # add our fields | ||||||||||||
| 48 | 1 | ▶ | $ccond->[_lang_] = $lang if $lang; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 49 | |||||||||||||
| 50 | 1 | return $ccond; | |||||||||||
| 51 | } | ||||||||||||
| 52 | #---------------------------------------------------------------------# | ||||||||||||
| 53 | |||||||||||||
| 54 | |||||||||||||
| 55 | # # | ||||||||||||
| 56 | # # | ||||||||||||
| 57 | ### Constructor ####################################################### | ||||||||||||
| 58 | |||||||||||||
| 59 | |||||||||||||
| 60 | |||||||||||||
| 61 | ### Accessors ######################################################### | ||||||||||||
| 62 | # # | ||||||||||||
| 63 | # # | ||||||||||||
| 64 | |||||||||||||
| 65 | # aliases | ||||||||||||
| 66 | 2 | *CSS::SAC::Condition::Lang::getLang = \⟪ | |||||||||||
| 67 | |||||||||||||
| 68 | #---------------------------------------------------------------------# | ||||||||||||
| 69 | # my $lang = $lcond->Lang() | ||||||||||||
| 70 | # $lcond->Lang($lang) | ||||||||||||
| 71 | # get/set the condition's lang | ||||||||||||
| 72 | #---------------------------------------------------------------------# | ||||||||||||
| 73 | 1 | ▶ | sub Lang { | ||||||||||
|
Subroutine
Lang: called CC=2 SCAR=7.6
Pod
documented
| |||||||||||||
| 74 | 1 | ▶ | (@_==2) ? $_[0]->[_lang_] = $_[1] : | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 75 | $_[0]->[_lang_]; | ||||||||||||
| 76 | } | ||||||||||||
| 77 | #---------------------------------------------------------------------# | ||||||||||||
| 78 | |||||||||||||
| 79 | |||||||||||||
| 80 | # # | ||||||||||||
| 81 | # # | ||||||||||||
| 82 | ### Accessors ######################################################### | ||||||||||||
| 83 | |||||||||||||
| 84 | |||||||||||||
| 85 | |||||||||||||
| 86 | 2 | 1; | |||||||||||
| 87 | |||||||||||||
| 88 | =pod | ||||||||||||
| 89 | |||||||||||||
| 90 | =head1 NAME | ||||||||||||
| 91 | |||||||||||||
| 92 | CSS::SAC::Condition::Lang - SAC LangConditions | ||||||||||||
| 93 | |||||||||||||
| 94 | =head1 SYNOPSIS | ||||||||||||
| 95 | |||||||||||||
| 96 | see CSS::SAC::Condition | ||||||||||||
| 97 | |||||||||||||
| 98 | =head1 DESCRIPTION | ||||||||||||
| 99 | |||||||||||||
| 100 | This is a subclass of CSS::SAC::Condition, look there for more | ||||||||||||
| 101 | documentation. This class adds the following methods (the spec | ||||||||||||
| 102 | equivalents are available as well, just prepend 'get'): | ||||||||||||
| 103 | |||||||||||||
| 104 | =head1 METHODS | ||||||||||||
| 105 | |||||||||||||
| 106 | =over 4 | ||||||||||||
| 107 | |||||||||||||
| 108 | =item * CSS::SAC::Condition::Lang->new($type,$lang) | ||||||||||||
| 109 | |||||||||||||
| 110 | =item * $cond->new($type,$lang) | ||||||||||||
| 111 | |||||||||||||
| 112 | Creates a new lang condition. | ||||||||||||
| 113 | |||||||||||||
| 114 | =item * $ccond->Lang([$lang]) | ||||||||||||
| 115 | |||||||||||||
| 116 | get/set the condition's lang | ||||||||||||
| 117 | |||||||||||||
| 118 | =back | ||||||||||||
| 119 | |||||||||||||
| 120 | =head1 AUTHOR | ||||||||||||
| 121 | |||||||||||||
| 122 | Robin Berjon <robin@knowscape.com> | ||||||||||||
| 123 | |||||||||||||
| 124 | This module is licensed under the same terms as Perl itself. | ||||||||||||
| 125 | |||||||||||||
| 126 | =cut | ||||||||||||
| 127 | |||||||||||||
| 128 | |||||||||||||