Skip to content

Commit

Permalink
Moving Hash Extras to Hash.Extras.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
timwienk committed Jun 16, 2010
1 parent 52e1c49 commit 953a07f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 25 deletions.
37 changes: 37 additions & 0 deletions Source/Types/Hash.Extras.js
@@ -0,0 +1,37 @@
/*
---
script: Hash.Extras.js
name: Hash.Extras
description: Extends the Hash Type to include getFromPath which allows a path notation to child elements.
license: MIT-style license
authors:
- Aaron Newton
requires:
- /Hash
provides: [Hash.Extras]
...
*/

Hash.implement({

getFromPath: function(notation){
return Object.getFromPath(this, notation);
},

cleanValues: function(method){
return new Hash(Object.cleanValues(this, method));
},

run: function(){
Object.run(arguments);
}

});
29 changes: 4 additions & 25 deletions Source/Types/Object.Extras.js
Expand Up @@ -3,9 +3,9 @@
script: Object.Extras.js
name: Hash.Extras
name: Object.Extras
description: Extends the Hash native object to include getFromPath which allows a path notation to child elements.
description: Extra Object generics, like getFromPath which allows a path notation to child elements.
license: MIT-style license
Expand All @@ -16,7 +16,7 @@ requires:
- Core/Object
- /MooTools.More
provides: [Object.Extras, Hash.Extras]
provides: [Object.Extras]
...
*/
Expand All @@ -42,7 +42,7 @@ Object.extend({
}
return object;
},

erase: function(object, key){
if(object.hasOwnProperty(key)) delete object[key];
return object;
Expand All @@ -56,24 +56,3 @@ Object.extend({
}

});


//<1.2compat>

Hash.implement({

getFromPath: function(notation){
return Object.getFromPath(this, notation);
},

cleanValues: function(method){
return new Hash(Object.cleanValues(this, method));
},

run: function(){
Object.run(arguments);
}

});

//</1.2compat>
1 change: 1 addition & 0 deletions package.yml
Expand Up @@ -31,6 +31,7 @@ sources:
- "Source/Types/URI.js"
- "Source/Types/URI.Relative.js"
- "Source/Types/Hash.js"
- "Source/Types/Hash.Extras.js"
- "Source/Element/Element.Forms.js"
- "Source/Element/Elements.From.js"
- "Source/Element/Element.Delegation.js"
Expand Down

0 comments on commit 953a07f

Please sign in to comment.