Skip to content

Commit

Permalink
refatoração para orientação a objetos
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpinhel committed Jan 27, 2019
1 parent 4973f98 commit 06afdd2
Show file tree
Hide file tree
Showing 21 changed files with 345 additions and 259 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ jspm_packages

# Output of 'npm pack'
*.tgz

# Compiled Lib
lib
dist
63 changes: 2 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Alimentômetro Wrapper

[![Build Status](https://travis-ci.org/alanpinhel/alimentometro-wrapper.svg?branch=master)](https://travis-ci.org/alanpinhel/alimentometro-wrapper) [![Coverage Status](https://coveralls.io/repos/github/alanpinhel/alimentometro-wrapper/badge.svg?branch=master)](https://coveralls.io/github/alanpinhel/alimentometro-wrapper?branch=master)
[![Build Status](https://travis-ci.org/alanpinhel/alimentometro-wrapper.svg?branch=master)](https://travis-ci.org/alanpinhel/alimentometro-wrapper) [![Coverage Status](https://coveralls.io/repos/github/alanpinhel/alimentometro-wrapper/badge.svg?branch=master)](https://coveralls.io/github/alanpinhel/alimentometro-wrapper?branch=master) ![Badge size](https://badge-size.herokuapp.com/alanpinhel/alimentometro-wrapper/master/dist/alimentometro-wrapper.min.js.svg) ![Badge gzip size](https://badge-size.herokuapp.com/alanpinhel/alimentometro-wrapper/master/dist/alimentometro-wrapper.min.js.svg?compression=gzip)

Wrapper para trabalhar com a [Relação de Fatores de Correção e Índice de Conversão (Cocção de Alimentos)](https://docs.ufpr.br/~monica.anjos/Fatores.pdf).

Expand All @@ -18,76 +18,17 @@ Esta biblioteca faz uso da [API de internacionalização](https://caniuse.com/#f
$ npm install alimentometro-wrapper --save
```


## Como usar

### ES6

```js
// to import a specific method
import SpotifyWrapper from 'spotify-wrapper';

const spotify = new SpotifyWrapper({
token: 'YOUR_TOKEN_HERE'
});

// using method
spotify.search.artists('Incubus');
```

### CommonJS

```js
const SpotifyWrapper = require('spotify-wrapper').default;

const spotify = new SpotifyWrapper({
token: 'YOUR_TOKEN_HERE'
});
```

### UMD in Browser

```html
<!-- to import non-minified version -->
<script src="spotify-wrapper.umd.js"></script>

<!-- to import minified version -->
<script src="spotify-wrapper.umd.min.js"></script>
```

After that the library will be available to the Global as `SpotifyWrapper`. Follow an example:

```js

const spotify = new SpotifyWrapper({
token: 'YOUR_TOKEN_HERE'
});

const albums = spotify.search.albums('Choosen Artist');
```

## Métodos

> Follow the methods that the library provides.
### search.albums(query)

> Search for informations about Albums with provided query. Test in [Spotify Web Console](https://developer.spotify.com/web-api/console/get-search-item/) with type defined as *album*.
**Arguments**

| Argument | Type | Options |
|----------|---------|-------------------|
|`query` |*string* | 'Any search query'|


**Example**

```js
spotify.search.albums('Incubus')
.then(data => {
// do what you want with the data
})
```

## Contribuição

Expand Down
1 change: 1 addition & 0 deletions src/alimentos.json → data/alimentos.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
{
"id": 1,
"nome": "Abacate",
"fatorCorrecao": 1.46,
"indiceConversao": 1
Expand Down
172 changes: 172 additions & 0 deletions dist/alimentometro-wrapper.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/alimentometro-wrapper.umd.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/alimentometro-wrapper.umd.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 06afdd2

Please sign in to comment.