From 0a34194965d16af97b59b5ff2d27da2aa157c7d3 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 1 Mar 2011 23:45:06 +0000 Subject: [PATCH] removed dependency on hashie --- lib/twhois.rb | 1 - lib/twhois/user.rb | 10 +++++++++- twhois.gemspec | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/twhois.rb b/lib/twhois.rb index d0d8533..5e4db43 100644 --- a/lib/twhois.rb +++ b/lib/twhois.rb @@ -3,7 +3,6 @@ require 'rubygems' require 'net/http' require 'json' -require 'hashie' require 'twhois/user' require 'twhois/version' diff --git a/lib/twhois/user.rb b/lib/twhois/user.rb index ec96c14..9cda763 100644 --- a/lib/twhois/user.rb +++ b/lib/twhois/user.rb @@ -1,7 +1,15 @@ # encoding: utf-8 module Twhois - class User < ::Hashie::Mash + # Kinda acts like the Hashie gem + class User + + def initialize(hash) + hash.keys.each do |key| + self.class.send(:attr_accessor, key.to_sym) + self.send("#{key}=", hash[key]) + end + end end end diff --git a/twhois.gemspec b/twhois.gemspec index fa9f1ed..21f834e 100644 --- a/twhois.gemspec +++ b/twhois.gemspec @@ -20,7 +20,6 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_runtime_dependency 'json_pure', '>= 1.0.0' - s.add_runtime_dependency 'hashie', '>= 1.0.0' s.add_development_dependency 'rspec', '>= 2.5.0' s.add_development_dependency 'yard', '>= 0.6.4'