Sha256: 054d7bf439ae3464130291a0912eced3d8f5857bd1d5d02e33035f33cb34e24e
Contents?: true
Size: 987 Bytes
Versions: 19
Compression:
Stored size: 987 Bytes
Contents
module FbGraph2 class AppLinkHost < Node register_attributes( raw: [:name, :canonical_url], custom: [:ios, :iphone, :ipad, :android, :windows_phone, :web] ) 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 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 end end
Version data entries
19 entries across 19 versions & 1 rubygems