Class: Spaceship::Tunes::AppReview

Inherits:
TunesBase show all
Defined in:
spaceship/lib/spaceship/tunes/app_review.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, attributes, #attributes, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#app_versionObject (readonly)

Returns the value of attribute app_version.



13
14
15
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 13

def app_version
  @app_version
end

#applicationObject

Returns the value of attribute application.



6
7
8
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 6

def application
  @application
end

#developer_responseObject

Returns the value of attribute developer_response.



19
20
21
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 19

def developer_response
  @developer_response
end

#editedObject (readonly)

Returns the value of attribute edited.



17
18
19
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 17

def edited
  @edited
end

#helpful_viewsObject (readonly)

Returns the value of attribute helpful_views.



15
16
17
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 15

def helpful_views
  @helpful_views
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 8

def id
  @id
end

#last_modifiedObject (readonly)

Returns the value of attribute last_modified.



14
15
16
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 14

def last_modified
  @last_modified
end

#nicknameObject (readonly)

Returns the value of attribute nickname.



11
12
13
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 11

def nickname
  @nickname
end

#ratingObject (readonly)

Returns the value of attribute rating.



7
8
9
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 7

def rating
  @rating
end

#raw_developer_responseObject (readonly)

Returns the value of attribute raw_developer_response.



18
19
20
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 18

def raw_developer_response
  @raw_developer_response
end

#reviewObject (readonly)

Returns the value of attribute review.



10
11
12
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 10

def review
  @review
end

#store_frontObject (readonly)

Returns the value of attribute store_front.



12
13
14
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 12

def store_front
  @store_front
end

#titleObject (readonly)

Returns the value of attribute title.



9
10
11
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 9

def title
  @title
end

#total_viewsObject (readonly)

Returns the value of attribute total_views.



16
17
18
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 16

def total_views
  @total_views
end

Class Method Details

.factory(attrs) ⇒ Object

Create a new object based on a hash. This is used to create a new object based on the server response.



38
39
40
41
42
43
44
45
46
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 38

def factory(attrs)
  obj = self.new(attrs)
  response_attrs = {}
  response_attrs = obj.raw_developer_response if obj.raw_developer_response
  response_attrs[:application] = obj.application
  response_attrs[:review_id] = obj.id
  obj.developer_response = DeveloperResponse.factory(response_attrs)
  return obj
end

Instance Method Details

#responded?Boolean

Returns:

  • (Boolean)


49
50
51
52
# File 'spaceship/lib/spaceship/tunes/app_review.rb', line 49

def responded?
  return true if raw_developer_response
  false
end