Sha256: df75526c554b98d4e61fe61cd80b7a90681917da7d0ea010088fc47768eb7d97

Contents?: true

Size: 968 Bytes

Versions: 1

Compression:

Stored size: 968 Bytes

Contents

module Rubyoverflow
  class Comment
  
    attr_reader :comment_id
    attr_reader :creation_date
    attr_reader :owner
    attr_reader :reply_to_user
    attr_reader :post_id
    attr_reader :post_type
    attr_reader :score
    attr_reader :edit_count
    attr_reader :body
  
    def initialize(hash, request_path = '')
      dash = CommentDash.new hash
    
      @comment_id = dash.comment_id
      @creation_date = dash.creation_date
      @owner = User.new dash.owner
      @reply_to_user = User.new dash.reply_to_user if dash.reply_to_user
      @post_id = dash.post_id
      @post_type = dash.post_type
      @score = dash.score
      @edit_count = dash.edit_count
      @body = dash.body
    end
  
  end

  class CommentDash < BaseDash
    property :comment_id
    property :creation_date
    property :owner
    property :reply_to_user
    property :post_id
    property :post_type
    property :score
    property :edit_count
    property :body
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubyoverflow-1.0.2 lib/rubyoverflow/comment.rb