module Spectra::Views

Public Class Methods

from_attributes(attributes) click to toggle source
# File lib/spectra/views/factory.rb, line 10
def self.from_attributes(attributes)
  klass = self.view_class(attributes[:type]) 
  klass.from_attributes(attributes) 
end
view_class(type) click to toggle source
# File lib/spectra/views/factory.rb, line 15
def self.view_class(type)
  case type.intern
    when :palette
      Palette
    when :objc    
      ObjcCategory
    when :swift   
      SwiftExtension
  end
end