Mercurial Hosting > luan
comparison mail/src/luan/modules/mail/SmtpCon.java @ 375:e2e70d27c258
simplify mail
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 17 Apr 2015 18:34:02 -0600 |
parents | cbb94a7c7a9e |
children | d9df6d6cb927 |
comparison
equal
deleted
inserted
replaced
374:538c19ad1272 | 375:e2e70d27c258 |
---|---|
74 private String getString(LuanState luan,Map<Object,Object> params,String key) throws LuanException { | 74 private String getString(LuanState luan,Map<Object,Object> params,String key) throws LuanException { |
75 Object val = params.remove(key); | 75 Object val = params.remove(key); |
76 if( val!=null && !(val instanceof String) ) | 76 if( val!=null && !(val instanceof String) ) |
77 throw luan.exception( "parameter '"+key+"' must be a string" ); | 77 throw luan.exception( "parameter '"+key+"' must be a string" ); |
78 return (String)val; | 78 return (String)val; |
79 } | |
80 | |
81 public LuanTable table() { | |
82 LuanTable tbl = Luan.newTable(); | |
83 try { | |
84 tbl.put( "send", new LuanJavaFunction( | |
85 SmtpCon.class.getMethod( "send", LuanState.class, LuanTable.class ), this | |
86 ) ); | |
87 } catch(NoSuchMethodException e) { | |
88 throw new RuntimeException(e); | |
89 } | |
90 return tbl; | |
91 } | 79 } |
92 | 80 |
93 | 81 |
94 public void send(LuanState luan,LuanTable mailTbl) throws LuanException { | 82 public void send(LuanState luan,LuanTable mailTbl) throws LuanException { |
95 try { | 83 try { |