Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Interface #48

Merged
merged 7 commits into from
Jun 19, 2015
Merged

Update Interface #48

merged 7 commits into from
Jun 19, 2015

Conversation

smizell
Copy link
Contributor

@smizell smizell commented Jun 18, 2015

This PR does several things.

  1. Allows obj.set({ foo: 'bar' }) to work for objects
  2. Converts meta to being a Minim object
  3. Converts attributes to being a Minim object
  4. Adds new getValue method which is short for obj.get('foo').toValue(). Now you can do obj.getValue('foo').

@smizell
Copy link
Contributor Author

smizell commented Jun 18, 2015

@danielgtaylor This will definitely need a look from you, as these are some big changes.


```javascript
var objectElement = new minim.ObjectElement({ foo: 'bar' });
var value = objectElement.getValue('foo') // returns 'bar'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems just objectElement.value(0) would be sufficient. As a rubyist my pull is to keep get and set out of method names, so I am biased.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an issues to discuss this.

#49

@smizell
Copy link
Contributor Author

smizell commented Jun 19, 2015

@fosrias I've addressed all comments.

expect(el.meta.class.toValue()).to.deep.equal(['a', 'b']);
expect(el.meta.title.toValue()).to.equal('Title');
expect(el.meta.description.toValue()).to.equal('Description');
expect(el.meta.get('id').toValue()).to.equal('foobar');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I cannot do: el.meta.id.toValue() now? This seems extra verbose (shock me).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do element.id, but currently not element.meta.id. It's the same interface now for any object with helper methods on element.

@fosrias
Copy link
Contributor

fosrias commented Jun 19, 2015

@smizell Fine by me. Leave to @danielgtaylor to clarify anything.

@zdne
Copy link
Member

zdne commented Jun 19, 2015

@fosrias @smizell

Leave to danielgtaylor to clarify anything.

Just a heads up: As far as I know Daniel is for two weeks off so you may want to merge it without him (but I leave that up to you)

smizell added a commit that referenced this pull request Jun 19, 2015
@smizell smizell merged commit 3b8ff7b into master Jun 19, 2015
@smizell smizell deleted the smizell/update-interface branch June 19, 2015 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants