lib/twitterland/mrtweet.rb in twitterland-0.4.5 vs lib/twitterland/mrtweet.rb in twitterland-0.4.6
- old
+ new
@@ -15,11 +15,11 @@
# Check whether the given user is a MrTweet user (always call API)
#
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').is_user
def is_user
- Mash.new(self.class.get("/is_user/#{@username}/#{@api_key}.json")).is_user
+ Hashie::Mash.new(self.class.get("/is_user/#{@username}/#{@api_key}.json")).is_user
end
# Check whether the given user is a MrTweet user (caches first request)
#
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').is_user?
@@ -30,40 +30,40 @@
# Returns MrTweet statistics of the given user
#
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').profile
def profile
if is_user?
- @profile ||= Mash.new(self.class.get("/profile/#{@username}/#{@api_key}.json")).profile
+ @profile ||= Hashie::Mash.new(self.class.get("/profile/#{@username}/#{@api_key}.json")).profile
end
end
# Returns the latest recommendations the given user received on MrTweet
#
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').recommendations
def recommendations
if is_user?
- @recommendations ||= Mash.new(self.class.get("/recommendations/#{@username}/#{@api_key}.json")).recommendations
+ @recommendations ||= Hashie::Mash.new(self.class.get("/recommendations/#{@username}/#{@api_key}.json")).recommendations
end
end
# Most attention towards
#
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').most_attention_towards
def most_attention_towards
if is_user?
- @most_attention_towards ||= Mash.new(self.class.get("/most_attention_towards/#{@username}/#{@api_key}.json")).most_attention_towards
+ @most_attention_towards ||= Hashie::Mash.new(self.class.get("/most_attention_towards/#{@username}/#{@api_key}.json")).most_attention_towards
end
end
# Recommend a user
#
# reason = "Wynn is an awesome entrepreneur, rubyist, designer and friend! Follow him for his useful and entertaining tweets!"
# friend_name = "pengwynn"
# Twitterland::Mrtweet.new(api_key,'bradleyjoyce').recommend(reason,friend_name)
def recommend(reason, friend_name)
if is_user?
- Mash.new(self.class.post("/recommend/#{@username}/#{@api_key}.json", :body => { :reason => reason, :friend_name => friend_name})).status == "success"
+ Hashie::Mash.new(self.class.post("/recommend/#{@username}/#{@api_key}.json", :body => { :reason => reason, :friend_name => friend_name})).status == "success"
end
end
end
end
\ No newline at end of file