Skip to content

Commit

Permalink
Added usage statements to Backtrace.pod and Blob.pod (except for pack,
Browse files Browse the repository at this point in the history
which seems out of place)
  • Loading branch information
dha committed Oct 5, 2015
1 parent ef69b16 commit ff764d8
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/Type/Backtrace.pod
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,42 @@ example routines like C<&die> are hidden by default.
=head2 method new
Defined as:
proto method new(*@, *%) {*}
multi method new()
Usage:
$backtrace = Backtrace.new
Creates a new backtrace, using its calling location as the origin of the
backtrace.
=head2 method Str
Defined as:
multi method Str(Backtrace:D:) returns Str:D:
Usage:
BACKTRACE.Str
Returns a concise string representation of the backtrace, omitting
routines marked as C<is hidden-from-backtrace>, and at the discretion of
the implementor, also some routines from the setting.
=head2 method full
Defined as:
multi method full(Backtrace:D:) returns Str:D:
Usage:
BACKTRACE.full
Returns a full string representation of the backtrace, including hidden
frames, compiler-specific frames and those from the setting.
Expand Down
36 changes: 36 additions & 0 deletions lib/Type/Blob.pod
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,62 @@ list-like interface to lists of integers, typically unsigned integers.
=head2 method new
Defined as:
method new(*@codes)
Usage:
$blob = Blob.new(LIST)
Creates a C<Blob> from a list of integers.
=head2 method Bool
Defined as:
multi method Bool(Blob:D:)
Usage:
BLOB.Bool
Returns C<False> if and only if the buffer is empty.
=head2 method elems
Defined as:
multi method elems(Blob:D:) returns Int:D
Usage:
BLOB.elems
Returns the number of elements of the buffer.
=head2 method decode
Defined as:
multi method decode(Blob:D: Str:D $encoding = 'UTF-8') returns Str:D
Usage:
BLOB.decode[(ENCODING)]
Applies an encoding to turn the blob into a L<Str|/type/Str>.
=head2 method subbuf
Defined as:
method subbuf(Int $from, Int $len = self.elems) returns Blob:D
Usage:
BLOB.subbuf(FROM [, LENGTH])
Extracts a part of the invocant buffer, starting from the index with
elements C<$from>, and taking C<$len> elements (or less if the buffer is
shorter), and creates a new buffer as the result.
Expand All @@ -47,8 +77,14 @@ shorter), and creates a new buffer as the result.
=head2 method unpack
Defined as:
method unpack(Blob:D: $template) returns List:D
Usage:
BLOB.unpack(TEMPLATE)
Extracts features from the blob according to the template string, and
returns them as a list.
Expand Down

0 comments on commit ff764d8

Please sign in to comment.