---
name: "Mock::Quick::Object"
section: "3pm"
platform: "linux"
package: "libmock-quick-perl"
version: "1.111-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Mock::Quick::Object"
---

# Mock::Quick::Object(3pm)

Object mocking for Mock::Quick

## NAME

Mock::Quick::Object - Object mocking for Mock::Quick

## DESCRIPTION

Provides object mocking. See Mock::Quick for a better interface.

## SYNOPSIS

```
    use Mock::Quick::Object;
    use Mock::Quick::Method;
    my $obj = Mock::Quick::Object->new(
        foo => 'bar',            # define attribute
        do_it => qmeth { ... },  # define method
        ...
    );
    is( $obj->foo, 'bar' );
    $obj->foo( 'baz' );
    is( $obj->foo, 'baz' );
    $obj->do_it();
    # define the new attribute automatically
    $obj->bar( 'xxx' );
    # define a new method on the fly
    $obj->baz( Mock::Quick::Method->new( sub { ... });
    # remove an attribute or method
    $obj->baz( \$Mock::Quick::Util::CLEAR );
```

## AUTHORS

Chad Granum exodist7@gmail.com

## COPYRIGHT

Copyright (C) 2011 Chad Granum

Mock-Quick is free software; Standard perl licence.

Mock-Quick is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
