Class: Rating

Inherits:
Object
  • Object
show all
Defined in:
lib/papercall/models/rating.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentsObject (readonly)

Returns the value of attribute comments.



4
5
6
# File 'lib/papercall/models/rating.rb', line 4

def comments
  @comments
end

#created_atObject (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

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/papercall/models/rating.rb', line 4

def id
  @id
end

#submission_idObject (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_atObject (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

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/papercall/models/rating.rb', line 4

def user
  @user
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/papercall/models/rating.rb', line 4

def value
  @value
end