Class: FaceGroup::Posting

Inherits:
Object
  • Object
show all
Defined in:
lib/facegroup/posting.rb

Overview

Single posting on group’s feed

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: nil) ⇒ Posting

Returns a new instance of Posting.



11
12
13
# File 'lib/facegroup/posting.rb', line 11

def initialize(data: nil)
  load_data(data)
end

Instance Attribute Details

#attachmentObject (readonly)

Returns the value of attribute attachment.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def attachment
  @attachment
end

#created_timeObject (readonly)

Returns the value of attribute created_time.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def created_time
  @created_time
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def id
  @id
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def message
  @message
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def name
  @name
end

#updated_timeObject (readonly)

Returns the value of attribute updated_time.



8
9
10
# File 'lib/facegroup/posting.rb', line 8

def updated_time
  @updated_time
end

Class Method Details

.find(id:) ⇒ Object



15
16
17
18
# File 'lib/facegroup/posting.rb', line 15

def self.find(id:)
  posting_data = FaceGroup::FbApi.posting_data(id)
  posting_data.keys.include?('error') ? nil : new(data: posting_data)
end