js-ruby-speak
v1.0.1
Published
A library of Ruby methods in ES2015
Downloads
20
Readme
Description
- A library of 20 utility functions inspired by Ruby functions and commands.
Context
- This goal is important in learning JavaScript and understanding how high level developer's write code for others to use and to understand ES2015. This code will be used by other developers to make their jobs easier. The questions that this project will raise is how do we write packages that are easy to understand out of the box and simple to use right away. how to publish a package to NPM?._
Installation
npm install js-ruby-speak --save
rjs = require('js-ruby-speak').default
var a = { a: 1 }
console.log('Cleared object a is', a.clear())
var b = { b: 2}
console.log('rjs.hashClear(b) is', rjs.hashClear(b))
Specifications
- [ ] Develop 30 functions defined in Ruby in ES2015.
- [x] Create a README that describes each method and provides an example of use.
- [x] Publish package to NPM.
- [x] Write tests for those methods described.
- [x] Showcase methods in a simple website app.
- [x] The artifact produced is properly licensed, preferably with the [MIT license][mit-license].
- [x] Learn Test Driven Development enough to know what it is
- [x] All code is linted by standard.js
- [x] Create a guide with workflow suggestions (git, teamwork, Friday retro, etc.) to document what the group did and recommends
- [x] Learn some Ruby
Functions
- arrayInitializeRange
- arrayAdd
- arraySubtract
- arrayToHash
- enumerableAny
- enumerableReject
- enumerableSelect
- enumerableGroupBy
- hashClear — also extends Object with #clear()
- hashEmpty
- hashHasKey
- hashInvert — also extends Object with #invert()
- hashMerge — also extends Object with #merge()
- hashToArray — also extends Object with #to_a()
- hashToString
- hashValues — also extends Object with #values()
- Number#numberEven - just extends Number with #even
- Number#numberOdd - just extends Number with #odd
- stringCap — also extends String with #toCap()
- timeWday
- stringClear - returns an empty string #strClear()