summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Doubrovkine (dB.) @dblockdotorg <dblock@dblock.org>2014-04-06 08:33:27 -0400
committerDaniel Doubrovkine (dB.) @dblockdotorg <dblock@dblock.org>2014-04-06 08:33:27 -0400
commit3a7feca9fc27780b65aafec74219371d504b486c (patch)
tree7f7e6a62e0833e31ba4f15b0a47e31ec5cf684fa
parent6c7b584eedd681bc64b94fa74a27b2096b84ba3a (diff)
parent2c4f96389f58576339e4ece42185cffdf6a8b6c1 (diff)
downloadhashie-3a7feca9fc27780b65aafec74219371d504b486c.tar.gz
Merge pull request #140 from markiz/issue-136-remove
Remove hashie/extensions/structure.rb because it never even worked
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/hashie/extensions/structure.rb45
2 files changed, 1 insertions, 45 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5dfc9e2..07e9599 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
## Next Release
+* Removed extra unused code - [@markiz](https://github.com/markiz).
* Removed support for Ruby 1.8.7 - [@dblock](https://github.com/dblock).
* Ruby style now enforced with Rubocop - [@dblock](https://github.com/dblock).
* [#107](https://github.com/intridea/hashie/pull/107): Fixed excessive value conversions, poor performance of deep merge in Hashie::Mash - [@davemitchell](https://github.com/dblock), [@dblock](https://github.com/dblock).
diff --git a/lib/hashie/extensions/structure.rb b/lib/hashie/extensions/structure.rb
deleted file mode 100644
index 302499b..0000000
--- a/lib/hashie/extensions/structure.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-module Hashie
- module Extensions
- # The Structure extension provides facilities for declaring
- # properties that a Hash can have. This provides for the
- # creation of structures that still behave like hashes but
- # do not allow setting non-allowed keys.
- #
- # @example
- # class RestrictedHash < Hash
- # include Hashie::Extensions::MergeInitializer
- # include Hashie::Extensions::Structure
- #
- # key :first
- # key :second, :default => 'foo'
- # end
- #
- # h = RestrictedHash.new(:first => 1)
- # h[:first] # => 1
- # h[:second] # => 'foo'
- # h[:third] # => ArgumentError
- #
- module Structure
- def self.included(base)
- base.extend ClassMethods
- base.class_eval do
- @permitted_keys = superclass.permitted_keys if superclass.respond_to?(:permitted_keys)
- end
- end
-
- module ClassMethods
- attr_reader :permitted_keys
-
- def key(key, options = {})
- (@permitted_keys ||= []) << key
-
- if options[:default]
- (@default_values ||= {})[key] = options.delete(:default)
- end
-
- permitted_keys
- end
- end
- end
- end
-end