Sha256: f7016bb21cd2985eaa4ed2e4ff868f383c86aaa5420589dba828df20dea25c36

Contents?: true

Size: 381 Bytes

Versions: 5

Compression:

Stored size: 381 Bytes

Contents

module MotionKit
  class ConstraintPlaceholder

    def initialize(type, name, value=nil)
      @type = type
      @name = name
      @value = value
    end

    def resolve(layout)
      case @type
      when :first
        layout.get_view(@name)
      when :last
        layout.last_view(@name)
      when :nth
        layout.nth_view(@name, @value)
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
motion-kit-0.13.0 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.12.0 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.11.2 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.11.1 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.11.0 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb