Skip to content

Commit

Permalink
Merge pull request #48 from refractproject/smizell/update-interface
Browse files Browse the repository at this point in the history
Update Interface
  • Loading branch information
smizell committed Jun 19, 2015
2 parents 14de9c0 + 384d435 commit 3b8ff7b
Show file tree
Hide file tree
Showing 5 changed files with 166 additions and 123 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Unreleased

- Allow `#set` to take an object for Object Elements
- Convert `meta` to be Minim Object Elements
- Convert `attributes` to be Minim Object Elements
- Sync class and method names with Refract 0.2.0 spec
- Add convenience methods for `meta` attributes, such as `id` or `class`
- Add finder functions, such as `findByElement` and `findByClass`
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,16 @@ The `get` method returns the item of the `ArrayElement` instance at the given in

```javascript
var arrayElement = new minim.ArrayElement(['a', 'b', 'c']);
var value = arrayElement.get(0) // get(0) returns 'a'
var value = arrayElement.get(0) // get(0) returns item for 'a'
```

##### getValue

The `getValue` method returns the value of the item of the `ArrayElement` instance at the given index.

```javascript
var arrayElement = new minim.ArrayElement(['a', 'b', 'c']);
var value = arrayElement.getValue(0) // get(0) returns 'a'
```

##### set
Expand Down Expand Up @@ -363,14 +372,23 @@ This is an element for representing objects. Objects store their items as an ord

##### get

The `get` method returns the value of the `ObjectElement` instance at the given name.
The `get` method returns the `ObjectElement` instance at the given name.
See `getKey` and `getMember` for ways to get more instances around a key-value pair.

```javascript
var objectElement = new minim.ObjectElement({ foo: 'bar' });
var value = objectElement.get('foo') // returns string instance for 'bar'
```

##### getValue

The `getValue` method returns the value of the `ObjectElement` instance at the given name.

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

##### getKey

The `getKey` method returns the key element of a key-value pair.
Expand Down
Loading

0 comments on commit 3b8ff7b

Please sign in to comment.