Class: Ayadn::PostObject
Overview
also works for messages
Instance Attribute Summary collapse
-
#annotations ⇒ Object
readonly
Returns the value of attribute annotations.
-
#canonical_url ⇒ Object
readonly
Returns the value of attribute canonical_url.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#entities ⇒ Object
readonly
Returns the value of attribute entities.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#is_deleted ⇒ Object
readonly
Returns the value of attribute is_deleted.
-
#machine_only ⇒ Object
readonly
Returns the value of attribute machine_only.
-
#num_replies ⇒ Object
readonly
Returns the value of attribute num_replies.
-
#num_reposts ⇒ Object
readonly
Returns the value of attribute num_reposts.
-
#num_stars ⇒ Object
readonly
Returns the value of attribute num_stars.
-
#pagination_id ⇒ Object
readonly
Returns the value of attribute pagination_id.
-
#reply_to ⇒ Object
readonly
Returns the value of attribute reply_to.
-
#repost_of ⇒ Object
readonly
Returns the value of attribute repost_of.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#view ⇒ Object
Returns the value of attribute view.
-
#you_reposted ⇒ Object
readonly
Returns the value of attribute you_reposted.
-
#you_starred ⇒ Object
readonly
Returns the value of attribute you_starred.
Instance Method Summary collapse
-
#initialize(hash) ⇒ PostObject
constructor
A new instance of PostObject.
Constructor Details
#initialize(hash) ⇒ PostObject
Returns a new instance of PostObject.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/ayadn/post_object.rb', line 89 def initialize hash @input = hash @num_stars = @input["num_stars"] @num_reposts = @input["num_reposts"] @num_replies = @input["num_replies"] @text = @input["text"] @created_at = @input["created_at"] @id = @input["id"] @canonical_url = @input["canonical_url"] @machine_only = @input["machine_only"] @you_reposted = @input["you_reposted"] @you_starred = @input["you_starred"] @thread_id = @input["thread_id"] @pagination_id = @input["pagination_id"] @source = PostSourceObject.new(@input) @entities = EntitiesObject.new(@input) @user = UserObject.new(@input["user"]) if !@input["annotations"].nil? @annotations = @input["annotations"].map { |hash| PostAnnotationObject.new(hash) } else @annotations = [] end @repost_of = PostObject.new(@input["repost_of"]) if !@input["repost_of"].blank? @reply_to = @input["reply_to"] @is_deleted = @input["is_deleted"] @channel_id = @input["channel_id"] end |
Instance Attribute Details
#annotations ⇒ Object (readonly)
Returns the value of attribute annotations.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def annotations @annotations end |
#canonical_url ⇒ Object (readonly)
Returns the value of attribute canonical_url.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def canonical_url @canonical_url end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def channel_id @channel_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def created_at @created_at end |
#entities ⇒ Object (readonly)
Returns the value of attribute entities.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def entities @entities end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def id @id end |
#input ⇒ Object (readonly)
Returns the value of attribute input.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def input @input end |
#is_deleted ⇒ Object (readonly)
Returns the value of attribute is_deleted.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def is_deleted @is_deleted end |
#machine_only ⇒ Object (readonly)
Returns the value of attribute machine_only.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def machine_only @machine_only end |
#num_replies ⇒ Object (readonly)
Returns the value of attribute num_replies.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def num_replies @num_replies end |
#num_reposts ⇒ Object (readonly)
Returns the value of attribute num_reposts.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def num_reposts @num_reposts end |
#num_stars ⇒ Object (readonly)
Returns the value of attribute num_stars.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def num_stars @num_stars end |
#pagination_id ⇒ Object (readonly)
Returns the value of attribute pagination_id.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def pagination_id @pagination_id end |
#reply_to ⇒ Object (readonly)
Returns the value of attribute reply_to.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def reply_to @reply_to end |
#repost_of ⇒ Object (readonly)
Returns the value of attribute repost_of.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def repost_of @repost_of end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def source @source end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def text @text end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def thread_id @thread_id end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def user @user end |
#view ⇒ Object
Returns the value of attribute view.
87 88 89 |
# File 'lib/ayadn/post_object.rb', line 87 def view @view end |
#you_reposted ⇒ Object (readonly)
Returns the value of attribute you_reposted.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def you_reposted @you_reposted end |
#you_starred ⇒ Object (readonly)
Returns the value of attribute you_starred.
86 87 88 |
# File 'lib/ayadn/post_object.rb', line 86 def you_starred @you_starred end |