~ubuntu-branches/ubuntu/precise/rakudo/precise

« back to all changes in this revision

Viewing changes to src/setting/Bool.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-10-04 14:31:57 UTC
  • Revision ID: james.westby@ubuntu.com-20091004143157-ubq3wu0grk0f1e6a
Tags: upstream-0.1~2009.09
ImportĀ upstreamĀ versionĀ 0.1~2009.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
class Bool is also {
 
2
 
 
3
=begin item ACCEPTS
 
4
 
 
5
=end item
 
6
    method ACCEPTS($topic) {
 
7
        return self;
 
8
    }
 
9
 
 
10
=begin item perl
 
11
 
 
12
=end item
 
13
    method perl() {
 
14
        return self ?? 'Bool::True' !! 'Bool::False';
 
15
    }
 
16
 
 
17
=begin item pick
 
18
 
 
19
Returns True or False
 
20
 
 
21
=end item
 
22
    method pick() {
 
23
        return rand < 0.5 ?? Bool::True !! Bool::False;
 
24
    }
 
25
 
 
26
}
 
27
 
 
28
# vim: ft=perl6