Sha256: 554e574bf55ff2455c65a2f6905aef7e3d874b8c3172ee4c5a4c3a5515f3c54b
Contents?: true
Size: 882 Bytes
Versions: 18
Compression:
Stored size: 882 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 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
18 entries across 18 versions & 1 rubygems