App/Chart/Suffix/TOCOM.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod n/a totaltotal 0.0% 0 / 42 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Tokyo Commodities Exchange (TOCOM) setups.
2  
3 # Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2016 Kevin Ryde
4  
5 # This file is part of Chart.
6 #
7 # Chart is free software; you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 3, or (at your option) any later
10 # version.
11 #
12 # Chart is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 # details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Chart. If not, see <http://www.gnu.org/licenses/>.
19  
20  
21 package App::Chart::Suffix::TOCOM;
22 use strict;
23 use warnings;
24 use Locale::TextDomain 'App-Chart';
25  
26 use App::Chart::Glib::Ex::MoreUtils;
27 use App::Chart;
28 use App::Chart::Sympred;
29 use App::Chart::TZ;
30 use App::Chart::Weblink;
31  
32  
33 my $pred = App::Chart::Sympred::Suffix->new ('.TOCOM');
34 App::Chart::TZ->tokyo->setup_for_symbol ($pred);
35  
36 # (source-help! tocom-symbol?
37 # (__p('manual-node','Tokyo Commodities Exchange')))
38  
39  
40 #-----------------------------------------------------------------------------
41 # weblinks - contract specs
42 #
43 # eg. http://www.tocom.or.jp/guide/youkou/gold/index.html
44 # http://www.tocom.or.jp/jp/guide/youkou/crude_oil/index.html
45 #
46  
47 App::Chart::Weblink->new
48 (pred => $pred,
49 name => __('TOCOM _Contract Specifications'),
50 desc => __('Open web browser at the Tokyo Commodities Exchange contract specifications for this commodity'),
51 proc => sub {
52 my ($symbol) = @_;
53 my $commodity = App::Chart::symbol_commodity ($symbol);
54 my $code = lc($commodity);
55 $code =~ s/ /_/g;
56 my $lang = App::Chart::Glib::Ex::MoreUtils::lang_select (en => '',
57 ja => 'jp/');
58 return "http://www.tocom.or.jp/${lang}guide/youkou/$code/index.html";
59 });
60  
61 1;
62 __END__