Class: MotionKit::ConstraintPlaceholder
- Defined in:
- lib/motion-kit-cocoa/constraints/constraint_placeholder.rb
Instance Method Summary collapse
-
#initialize(type, name, value = nil) ⇒ ConstraintPlaceholder
constructor
A new instance of ConstraintPlaceholder.
- #resolve(layout) ⇒ Object
Constructor Details
#initialize(type, name, value = nil) ⇒ ConstraintPlaceholder
Returns a new instance of ConstraintPlaceholder.
4 5 6 7 8 |
# File 'lib/motion-kit-cocoa/constraints/constraint_placeholder.rb', line 4 def initialize(type, name, value=nil) @type = type @name = name @value = value end |
Instance Method Details
#resolve(layout) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/motion-kit-cocoa/constraints/constraint_placeholder.rb', line 10 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 |