NAME

JIRA::REST::Class::Mixins - An mixin class for JIRA::REST::Class that other objects can inherit methods from.

VERSION

version 0.03

METHODS

name_for_user

When passed a scalar that could be a JIRA::REST::Class::User object, returns the name of the user if it is a JIRA::REST::Class::User object, or the unmodified scalar if it is not.

key_for_issue

When passed a scalar that could be a JIRA::REST::Class::Issue object, returns the key of the issue if it is a JIRA::REST::Class::Issue object, or the unmodified scalar if it is not.

When passed two scalars, one that could be a JIRA::REST::Class::Issue::LinkType object and another that is a direction (inward/outward), returns the name of the link type and direction if it is a JIRA::REST::Class::Issue::LinkType object, or attempts to determine the link type and direction from the provided scalars.

dump

Returns a stringified representation of the object's data generated somewhat by Data::Dumper::Concise, but only going one level deep. If it finds objects in the data, it will attempt to represent them in some abbreviated fashion which may not display all the data in the object.

INTERNAL METHODS

jira

Returns a JIRA::REST::Class object with credentials for the last JIRA user.

factory

An accessor for the JIRA::REST::Class::Factory.

JIRA_REST

An accessor that returns the JIRA::REST object being used.

REST_CLIENT

An accessor that returns the REST::Client object inside the JIRA::REST object being used.

make_object

A pass-through method that calls JIRA::REST::Class::Factory::make_object().

make_date

A pass-through method that calls JIRA::REST::Class::Factory::make_date().

class_for

A pass-through method that calls JIRA::REST::Class::Factory::get_factory_class().

obj_isa

When passed a scalar that could be an object and a class string, returns whether the scalar is, in fact, an object of that class. Looks up the actual class using class_for(), which calls JIRA::REST::Class::Factory::get_factory_class().

deep_copy

Returns a deep copy of the hashref it is passed

Example:

   my $bar = Class->deep_copy($foo);
   $bar->{XXX} = 'new value'; # $foo->{XXX} isn't changed

shallow_copy THING

A utility function to produce a shallow copy of a thing (mostly not going down into the contents of objects within objects).

AUTHOR

Packy Anderson <packy@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Packy Anderson.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)