lib/hockeyhelper/app.rb in hockeyhelper-0.0.1 vs lib/hockeyhelper/app.rb in hockeyhelper-0.0.2
- old
+ new
@@ -11,11 +11,11 @@
attr_reader :release_type
attr_reader :status
attr_reader :platform
attr_reader :original_hash
- attr :net, :users
+ attr :net
def self.create_from(hashobj, networking)
self.new hashobj, networking
end
@@ -29,10 +29,11 @@
@status = hashobj['status']
@platform = hashobj['platform']
@original_hash = hashobj
@net = networking
@users = nil
+ @versions = nil
end
def inspect
"#{@title}, #{@bundle_identifier}, #{@platform}, #{@public_identifier}"
end
@@ -56,9 +57,22 @@
obj['app_users'].each do |hashobj|
@users << User.create_from(hashobj, @net)
end
@users
+ end
+
+ def versions
+ return @versions if @versions
+
+ obj = @net.get_object "/api/2/apps/#{@public_identifier}/app_versions"
+
+ @versions = []
+ obj['app_versions'].each do |hashobj|
+ @versions << Version.create_from(hashobj, @net)
+ end
+
+ @versions
end
def invite_user(email:email)
obj = @net.post_object "/api/2/apps/#{@public_identifier}/app_users", {:email=>email, :role=>1}
\ No newline at end of file