Comparing version
@@ -19,2 +19,6 @@ 'use strict'; | ||
var _integer = require('./integer'); | ||
var _integer2 = _interopRequireDefault(_integer); | ||
var _string = require('./string'); | ||
@@ -35,2 +39,4 @@ | ||
this.int = new _integer2['default'](); | ||
this.str = new _string2['default'](); | ||
@@ -42,8 +48,17 @@ | ||
_createClass(Ruby, [{ | ||
key: 'add_methods_to_number_prototype', | ||
value: function add_methods_to_number_prototype() { | ||
var _this = this; | ||
(0, _lodash.each)((0, _lodash.functions)(this.int), function (method) { | ||
Object.defineProperty(Number.prototype, method, { get: _this.int[method] }); | ||
}); | ||
} | ||
}, { | ||
key: 'add_methods_to_string_prototype', | ||
value: function add_methods_to_string_prototype() { | ||
var _this = this; | ||
var _this2 = this; | ||
(0, _lodash.each)((0, _lodash.functions)(this.str), function (method) { | ||
Object.defineProperty(String.prototype, method, { get: _this.str[method] }); | ||
Object.defineProperty(String.prototype, method, { get: _this2.str[method] }); | ||
}); | ||
@@ -50,0 +65,0 @@ } |
{ | ||
"name": "ruby", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Helper methods from ruby ported to Node.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
318462
3.61%35
6.06%296
12.12%