Sha256: ab84510c4c0d429e1e8c75d8f4825071846a82e367a1076beacacde4a9dddc5b

Contents?: true

Size: 447 Bytes

Versions: 1

Compression:

Stored size: 447 Bytes

Contents

require_relative 'user'

class Rating
  attr_reader :id, :submission_id, :value, :comments, :created_at, :updated_at, :user

  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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
papercall-1.0.0 lib/papercall/models/rating.rb