Sha256: 8482c6296dc5c4698fec90a8f7d45628b5c379d5d5a97f5529d805556a0edf1c

Contents?: true

Size: 846 Bytes

Versions: 20

Compression:

Stored size: 846 Bytes

Contents

module Teacup
  module_function

  def apply_method(target, assign, setter, value)
    if assign and target.respond_to?(assign)
      NSLog "Setting #{key} = #{value.inspect}" if target.respond_to? :debug and target.debug
      target.send(assign, value)
    elsif target.respondsToSelector(setter)
      NSLog "Calling target.#{setter}(#{value.inspect})" if target.respond_to? :debug and target.debug
      target.send(setter, value)
    elsif target.is_a?(self.AppearanceClass)
      NSLog "Calling target.#{setter}(#{value.inspect})" if target.respond_to? :debug and target.debug
      target.send(setter, value)
    else
      NSLog "TEACUP WARNING: Can't apply #{setter.inspect}#{assign and " or " + assign.inspect or ""} to #{target.inspect}"
    end
  end

  def AppearanceClass
    @appearance_klass ||= UIView.appearance.class
  end

end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
teacup-2.1.13 lib/teacup-ios/handler.rb
teacup-2.1.12 lib/teacup-ios/handler.rb
teacup-2.1.11 lib/teacup-ios/handler.rb
teacup-2.1.10 lib/teacup-ios/handler.rb
teacup-2.1.9 lib/teacup-ios/handler.rb
teacup-2.1.8 lib/teacup-ios/handler.rb
teacup-2.1.7 lib/teacup-ios/handler.rb
teacup-2.1.6 lib/teacup-ios/handler.rb
teacup-2.1.5 lib/teacup-ios/handler.rb
teacup-2.1.4 lib/teacup-ios/handler.rb
teacup-2.1.3 lib/teacup-ios/handler.rb
teacup-2.1.2 lib/teacup-ios/handler.rb
teacup-2.1.1 lib/teacup-ios/handler.rb
teacup-2.1.0 lib/teacup-ios/handler.rb
teacup-2.0.6 lib/teacup-ios/handler.rb
teacup-2.0.5 lib/teacup-ios/handler.rb
teacup-2.0.4 lib/teacup-ios/handler.rb
teacup-2.0.3 lib/teacup-ios/handler.rb
teacup-2.0.2 lib/teacup-ios/handler.rb
teacup-2.0.0 lib/teacup-ios/handler.rb