App-Ylastic-CostAgent

 view release on metacpan or  search on metacpan

lib/App/Ylastic/CostAgent.pm  view on Meta::CPAN

#
# Parameters for new:
#   * config_file -- path to a .ini style configuration file (required)
#   * dir -- a directory to hold downloaded data (defaults to a tempdir)
#   * logger -- a Log::Dispatchouli object (defaults to a null logger)
#   * upload -- whether to upload data to Ylastic (default is false)
#--------------------------------------------------------------------------#

sub new {
  my $class = shift;
  my $self = $class->SUPER::new( @_ );

  croak __PACKAGE__ . " requires a valid 'config_file' argument\n"
    unless $self->config_file && -r $self->config_file;

  $self->{logger} ||= Log::Dispatchouli->new({ident => __PACKAGE__, to_self => 1});
  $self->{dir} ||= File::Temp::tempdir();
  $self->_parse_config;

  return $self;
}



( run in 0.616 second using v1.01-cache-2.11-cpan-5a3173703d6 )