NAME
JIRA::REST::Class::Abstract - An abstract class for JIRA::REST::Class
that most of the other objects are based on.
VERSION
version 0.01
METHODS
init
Method to perform post-instantiation initialization of the object. The first argument will be the factory object which created the object.
unload_lazy
Clears the hash that tracks lazily loaded methods so they get loaded again.
factory
Returns the JIRA::REST::Class::Factory
object that created this object.
jira
Returns the JIRA::REST::Class
object that created this object.
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()
.
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.
find_link_name_and_direction
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.
mk_contextual_ro_accessors list of accessors to make
Because I didn't want to give up Class::Accessor::Fast, but wanted to be able to make contextual accessors when it was useful.
mk_deep_ro_accessor LIST OF KEYS TO HASH
Why do accessors have to be only for the top level of the hash? Why can't they be several layers deep? This method takes a list of keys for the hash this object is based on and creates an accessor that goes down deeper than just the first level.
mk_lazy_ro_accessor field, sub_ref_to_construct_value
Makes an accessor that checks to see if the value for the accessor has been loaded, and, if it hasn't, runs the provided subroutine to construct the value. Especially good for loading values that are objects populated by REST calls.
dump
Returns a stringified representation of the issue's data generated by Data::Dumper::Concise.
INTERNAL METHODS
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.
populate_scalar_data
Code to make instantiating objects from $self->data easier.
populate_date_data
Code to make instantiating DateTime objects from $self->data easier.
populate_list_data
Code to make instantiating lists of objects from $self->data easier.
populate_scalar_field
Code to make instantiating objects from fields easier.
populate_list_field
Code to make instantiating lists of objects from fields easier.
mk_data_ro_accessors
Makes accessors for keys under $self->{data}
mk_field_ro_accessors
Makes accessors for keys under $self->{data}->{fields}
make_subroutine
Takes a subroutine name and a subroutine reference, and blesses the subroutine into the class used to call this method. Can be called with either a class name or a blessed object reference.
shallow_dump THING
A utility function to produce a shallow dump of a thing.
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)