Module: Zuck::FbObject::Read
- Included in:
- RawFbObject
- Defined in:
- lib/zuck/fb_object/read.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(graph, data = {}, parent = nil) ⇒ Object
-
#reload ⇒ Object
Refetches the data from façeboko.
Class Method Details
.included(base) ⇒ Object
4 5 6 |
# File 'lib/zuck/fb_object/read.rb', line 4 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#initialize(graph, data = {}, parent = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/zuck/fb_object/read.rb', line 13 def initialize(graph, data = {}, parent=nil) self.graph = graph set_data(data) # If the parent is an {AdAccount} we only want to set it as this # object's direct parent when this object is an {AdCampaign}. if !parent.is_a?(AdAccount) or parent.is_a?(AdAccount) and self.is_a?(AdCampaign) set_parent(parent) end end |
#reload ⇒ Object
Refetches the data from façeboko
25 26 27 28 29 |
# File 'lib/zuck/fb_object/read.rb', line 25 def reload data = get(graph, path) set_data(data) self end |