Class: Githu3::Comment

Inherits:
Resource show all
Defined in:
lib/githu3/comment.rb

Instance Method Summary collapse

Methods inherited from Resource

#_attributes, #_path, #get, #id, #initialize, #method_missing

Methods included from Relations

#embeds_many, #embeds_one, #has_many

Constructor Details

This class inherits a constructor from Githu3::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Githu3::Resource

Instance Method Details

#_mime_type(mt) ⇒ Object



15
16
17
# File 'lib/githu3/comment.rb', line 15

def _mime_type mt
  "application/vnd.github-#{_type}.#{mt}+json"
end

#_typeObject



6
7
8
9
10
11
12
13
# File 'lib/githu3/comment.rb', line 6

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