apartment_ratings 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/apartment_ratings.gemspec +2 -2
- data/lib/apartment_ratings/complex.rb +1 -1
- data/lib/apartment_ratings/review.rb +5 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.1.0
|
data/apartment_ratings.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "apartment_ratings"
|
8
|
-
s.version = "1.0
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["gregory"]
|
12
|
-
s.date = "2014-09-
|
12
|
+
s.date = "2014-09-30"
|
13
13
|
s.description = "Ruby client for ApartmentRating API"
|
14
14
|
s.email = "greg2502@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -3,7 +3,7 @@ module ApartmentRatings
|
|
3
3
|
include Hashie::Extensions::IndifferentAccess
|
4
4
|
include Hashie::Extensions::Coercion
|
5
5
|
|
6
|
-
property :datePosted
|
6
|
+
property :created_at, from: :datePosted
|
7
7
|
property :text, from: :fullReviewText
|
8
8
|
property :responses
|
9
9
|
property :author, from: :reviewerScreenName
|
@@ -13,5 +13,9 @@ module ApartmentRatings
|
|
13
13
|
|
14
14
|
coerce_key :responses, Set[ApartmentRatings::Reviews::Response]
|
15
15
|
coerce_key :rating, Hash[String => ApartmentRatings::Reviews::Rating]
|
16
|
+
|
17
|
+
def avg_rating
|
18
|
+
rating.sum{|_, rating| rating.value.nil? ? 0 : rating.value } / [rating.keys.size, 1].max.to_f
|
19
|
+
end
|
16
20
|
end
|
17
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apartment_ratings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hashie
|
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
255
|
version: '0'
|
256
256
|
segments:
|
257
257
|
- 0
|
258
|
-
hash:
|
258
|
+
hash: -2538087811996024814
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
none: false
|
261
261
|
requirements:
|