Sha256: 4906bfab8174e5fb9e03f12c13404147f3a1a1c1b3b3a449dcbf73af6bd718d0

Contents?: true

Size: 366 Bytes

Versions: 18

Compression:

Stored size: 366 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(@name)
      when :last
        layout.last(@name)
      when :nth
        layout.nth(@name, @value)
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
motion-kit-0.10.11 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.10 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.9 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.8 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.7 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.6 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.5 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.4 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.3 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.2 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.1 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.10.0 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.6 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.4 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.3 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.2 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.1 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
motion-kit-0.9.0 lib/motion-kit-cocoa/constraints/constraint_placeholder.rb