Class: Rubyoverflow::Revision

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyoverflow/revision.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, request_path = '') ⇒ Revision

Returns a new instance of Revision.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rubyoverflow/revision.rb', line 20

def initialize(hash, request_path = '')
  dash = RevisionDash.new hash

  @body = dash.body
  @comment = dash.comment
  @creation_date = dash.creation_date
  @is_question = dash.is_question
  @is_rollback = dash.is_rollback
  @last_body = dash.last_body
  @last_title = dash.last_title
  @last_tags = dash.last_tags
  @revision_guid = dash.revision_guid
  @revision_number = dash.revision_number
  @tags = dash.tags
  @title = dash.title
  @revision_type = dash.revision_type
  @set_community_wiki = dash.set_community_wiki
  @user = User.new dash.user if dash.user
  @post_id = dash.post_id
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



3
4
5
# File 'lib/rubyoverflow/revision.rb', line 3

def body
  @body
end

#commentObject (readonly)

Returns the value of attribute comment.



4
5
6
# File 'lib/rubyoverflow/revision.rb', line 4

def comment
  @comment
end

#creation_dateObject (readonly)

Returns the value of attribute creation_date.



5
6
7
# File 'lib/rubyoverflow/revision.rb', line 5

def creation_date
  @creation_date
end

#is_questionObject (readonly)

Returns the value of attribute is_question.



6
7
8
# File 'lib/rubyoverflow/revision.rb', line 6

def is_question
  @is_question
end

#is_rollbackObject (readonly)

Returns the value of attribute is_rollback.



7
8
9
# File 'lib/rubyoverflow/revision.rb', line 7

def is_rollback
  @is_rollback
end

#last_bodyObject (readonly)

Returns the value of attribute last_body.



8
9
10
# File 'lib/rubyoverflow/revision.rb', line 8

def last_body
  @last_body
end

#last_tagsObject (readonly)

Returns the value of attribute last_tags.



10
11
12
# File 'lib/rubyoverflow/revision.rb', line 10

def last_tags
  @last_tags
end

#last_titleObject (readonly)

Returns the value of attribute last_title.



9
10
11
# File 'lib/rubyoverflow/revision.rb', line 9

def last_title
  @last_title
end

#post_idObject (readonly)

Returns the value of attribute post_id.



18
19
20
# File 'lib/rubyoverflow/revision.rb', line 18

def post_id
  @post_id
end

#revision_guidObject (readonly)

Returns the value of attribute revision_guid.



11
12
13
# File 'lib/rubyoverflow/revision.rb', line 11

def revision_guid
  @revision_guid
end

#revision_numberObject (readonly)

Returns the value of attribute revision_number.



12
13
14
# File 'lib/rubyoverflow/revision.rb', line 12

def revision_number
  @revision_number
end

#revision_typeObject (readonly)

Returns the value of attribute revision_type.



15
16
17
# File 'lib/rubyoverflow/revision.rb', line 15

def revision_type
  @revision_type
end

#set_community_wikiObject (readonly)

Returns the value of attribute set_community_wiki.



16
17
18
# File 'lib/rubyoverflow/revision.rb', line 16

def set_community_wiki
  @set_community_wiki
end

#tagsObject (readonly)

Returns the value of attribute tags.



13
14
15
# File 'lib/rubyoverflow/revision.rb', line 13

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



14
15
16
# File 'lib/rubyoverflow/revision.rb', line 14

def title
  @title
end

#userObject (readonly)

Returns the value of attribute user.



17
18
19
# File 'lib/rubyoverflow/revision.rb', line 17

def user
  @user
end