Class: Serel::Question

Inherits:
Base
  • Object
show all
Defined in:
lib/serel/question.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from Base

#[], #[]=, #all, associations, attribute, config, #find, finder_methods, #get, #initialize, #inspect, #meth, method_missing, #network, network_wide, new_relation, request, respond_to?, #type, with_ids

Constructor Details

This class inherits a constructor from Serel::Base

Class Method Details



34
35
36
# File 'lib/serel/question.rb', line 34

def self.featured
  url("questions/featured")
end

+ (Object) no_answers



50
51
52
# File 'lib/serel/question.rb', line 50

def self.no_answers
  url("questions/no-answers")
end

+ (Object) search



38
39
40
# File 'lib/serel/question.rb', line 38

def self.search
  url("search")
end

+ (Object) similar



42
43
44
# File 'lib/serel/question.rb', line 42

def self.similar
  url("similar")
end

+ (Object) unanswered



46
47
48
# File 'lib/serel/question.rb', line 46

def self.unanswered
  url("questions/unanswered")
end

Instance Method Details

- (Object) answers



54
55
56
# File 'lib/serel/question.rb', line 54

def answers
  type(:answer).url("questions/#{id}/answers")
end

- (Object) comments



58
59
60
# File 'lib/serel/question.rb', line 58

def comments
  type(:comment).url("questions/#{id}/comments")
end

- (Object) linked



62
63
64
# File 'lib/serel/question.rb', line 62

def linked
  type(:question).url("questions/#{id}/linked")
end


66
67
68
# File 'lib/serel/question.rb', line 66

def related
  type(:question).url("questions/#{id}/related")
end

- (Serel::Relation) revisions

Get the revisions on a question.

Returns:



72
73
74
# File 'lib/serel/question.rb', line 72

def revisions
  type(:revision).url("posts/#{id}/revisions")
end

- (Serel::Relation) suggested_edits

Get the suggested edits on a question

Returns:



78
79
80
# File 'lib/serel/question.rb', line 78

def suggested_edits
  type(:suggested_edit).url("posts/#{id}/suggested-edits")
end

- (Object) timeline



82
83
84
# File 'lib/serel/question.rb', line 82

def timeline
  type(:timeline).url("questions/#{id}/timeline")
end