NAME

WWW::LogicBoxes::Contact::Factory - Factory for Construction of Contact Objects

SYNOPSIS

use WWW::LogicBoxes;
use WWW::LogicBoxes::Contact::Factory;

my $api = WWW::LogicBoxes->new( ... );

my $response = $api->submit({
    method => 'contacts__details',
    params => {
        'contact-id' => 42,
    },
});

my $contact = WWW::LogicBoxes::Contact::Factory->construct_from_response( $response );

DESCRIPTION

Abstract Factory that accepts the raw response from LogicBoxes and returns a fully formed WWW::LogicBoxes::Contact or one of it's subclasses.

METHODS

construct_from_response

my $response = $api->submit({
    method => 'contacts__details',
    params => {
        'contact-id' => 42,
    },
});

my $contact = WWW::LogicBoxes::Contact::Factory->construct_from_response( $response );

Given a HashRef that is the JSON response from LogicBoxes when retrieving contact details, returns an instance of WWW::LogicBoxes::Contact or one of it's subclasses.