Class: Rating
- Inherits:
-
Object
- Object
- Rating
- Defined in:
- lib/papercall/models/rating.rb
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#submission_id ⇒ Object
readonly
Returns the value of attribute submission_id.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(json_hash) ⇒ Rating
constructor
A new instance of Rating.
Constructor Details
#initialize(json_hash) ⇒ Rating
Returns a new instance of Rating.
6 7 8 9 10 11 12 13 14 |
# File 'lib/papercall/models/rating.rb', line 6 def initialize(json_hash) @id = json_hash[:id] @submission_id = json_hash[:submission_id] @value = json_hash[:value] @comments = json_hash[:comments] @created_at = Time.parse(json_hash[:created_at]) @updated_at = Time.parse(json_hash[:updated_at]) @user = User.new(json_hash[:user]) end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def comments @comments end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def created_at @created_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def id @id end |
#submission_id ⇒ Object (readonly)
Returns the value of attribute submission_id.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def submission_id @submission_id end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def updated_at @updated_at end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def user @user end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/papercall/models/rating.rb', line 4 def value @value end |