class FbGraph2::AppLinkHost
Public Class Methods
new(id, attributes = {})
click to toggle source
Calls superclass method
# File lib/fb_graph2/app_link_host.rb, line 8 def initialize(id, attributes = {}) super [:ios, :iphone, :ipad, :android, :windows_phone].each do |link_attr| if attributes.include? link_attr self.send :"#{link_attr}=", collect_links(attributes, link_attr) end end if attributes.include? :web self.web = Struct::AppLink::Web.new attributes[:web] end end
Private Instance Methods
collect_links(attributes, link_attr)
click to toggle source
# File lib/fb_graph2/app_link_host.rb, line 22 def collect_links(attributes, link_attr) Collection.new(attributes[link_attr]).collect! do |link| klass = case link_attr when :ios, :iphone, :ipad Struct::AppLink::Native::IOS when :android Struct::AppLink::Native::Android when :windows_phone Struct::AppLink::Native::WindowsPhone end klass.new link end end