Class: FansWatch::Page
- Inherits:
-
Object
- Object
- FansWatch::Page
- Defined in:
- lib/fanswatch/page.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(page_data:) ⇒ Page
constructor
A new instance of Page.
Constructor Details
#initialize(page_data:) ⇒ Page
Returns a new instance of Page.
10 11 12 13 14 15 |
# File 'lib/fanswatch/page.rb', line 10 def initialize(page_data:) @name = page_data['name'] @id = page_data['id'] @feed = Feed.new(feed_data: @id) end |
Instance Attribute Details
#feed ⇒ Object (readonly)
Returns the value of attribute feed.
8 9 10 |
# File 'lib/fanswatch/page.rb', line 8 def feed @feed end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/fanswatch/page.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/fanswatch/page.rb', line 8 def name @name end |
Class Method Details
.find(id:) ⇒ Object
17 18 19 20 |
# File 'lib/fanswatch/page.rb', line 17 def self.find(id:) page_data = FbApi.page_info(id) page_data.include?('error') ? nil : new(page_data: page_data) end |