Sha256: 0a6b089fb189791befe8c5fb6487503a348aab4e10e7cef4ec5228ec073ad261

Contents?: true

Size: 376 Bytes

Versions: 5

Compression:

Stored size: 376 Bytes

Contents

module Githu3
  class Comment < Githu3::Resource
    
    embeds_one :user
    
    def _type
      m = url.match(/(issues|gists|pulls)\/comments\/[0-9]+$/)
      if m.nil? || m[1].nil?
        "commitcomment"
      else
        "#{m[1].singularize}comment"
      end
    end
    
    def _mime_type mt
      "application/vnd.github-#{_type}.#{mt}+json"
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
githu3-0.0.8 lib/githu3/comment.rb
githu3-0.0.7 lib/githu3/comment.rb
githu3-0.0.6 lib/githu3/comment.rb
githu3-0.0.5 lib/githu3/comment.rb
githu3-0.0.4 lib/githu3/comment.rb