Class: FaceGroups::Group
- Inherits:
-
Object
- Object
- FaceGroups::Group
- Defined in:
- lib/facegroups/group.rb
Overview
Main class to setup a Facebook group
Instance Attribute Summary collapse
-
#feed ⇒ Object
readonly
Returns the value of attribute feed.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(group_data:) ⇒ Group
constructor
A new instance of Group.
Constructor Details
permalink #initialize(group_data:) ⇒ Group
Returns a new instance of Group.
10 11 12 13 14 |
# File 'lib/facegroups/group.rb', line 10 def initialize(group_data:) @name = group_data['name'] @id = group_data['id'] @feed = Feed.new(feed_data: group_data['feed']) end |
Instance Attribute Details
permalink #feed ⇒ Object (readonly)
Returns the value of attribute feed.
8 9 10 |
# File 'lib/facegroups/group.rb', line 8 def feed @feed end |
permalink #id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/facegroups/group.rb', line 8 def id @id end |
permalink #name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/facegroups/group.rb', line 8 def name @name end |
Class Method Details
permalink .find(id:) ⇒ Object
[View source]
16 17 18 19 |
# File 'lib/facegroups/group.rb', line 16 def self.find(id:) group_data = FbApi.group_data(id) group_data.include?('error') ? nil : new(group_data: group_data) end |