Module: FbGraph::Serialization

Included in:
Location, Privacy, Tag
Defined in:
lib/fb_graph/serialization.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) as_json(options = {})



7
8
9
10
11
12
13
# File 'lib/fb_graph/serialization.rb', line 7

def as_json(options = {})
  hash = self.to_hash options
  hash.delete_if do |k, v|
    v.blank?
  end
  hash
end

- (Object) to_hash(options = {})



3
4
5
# File 'lib/fb_graph/serialization.rb', line 3

def to_hash(options = {})
  raise "Define #{self.class}#to_hash!"
end

- (Object) to_json(options = {})



15
16
17
# File 'lib/fb_graph/serialization.rb', line 15

def to_json(options = {})
  as_json.to_json options
end