Commit 435186b
Changed files (3)
app
controllers
app/controllers/controls/build.rb
@@ -0,0 +1,5 @@
+class Build
+ def self.text_field(coordinates)
+ TextBoxBuilder.new(coordinates)
+ end
+end
app/controllers/controls/text_box_builder.rb
@@ -0,0 +1,15 @@
+class TextBoxBuilder
+ def initialize(coordinates)
+ @text_field = UITextField.alloc.initWithFrame(coordinates)
+ @text_field.autocapitalizationType = UITextAutocapitalizationTypeNone
+ @text_field.borderStyle = UITextBorderStyleRoundedRect
+ end
+ def centered_within(view)
+ @text_field.textAlignment = UITextAlignmentCenter
+ @text_field.center = CGPointMake(view.frame.size.width / 2, view.frame.size.height / 2 - 100)
+ self
+ end
+ def build
+ @text_field
+ end
+end
app/controllers/restaurant_controller.rb
@@ -33,25 +33,3 @@ class RestaurantController < UIViewController
self.view.addSubview(view)
end
end
-
-class Build
- def self.text_field(coordinates)
- TextBoxBuilder.new(coordinates)
- end
-end
-
-class TextBoxBuilder
- def initialize(coordinates)
- @text_field = UITextField.alloc.initWithFrame(coordinates)
- @text_field.autocapitalizationType = UITextAutocapitalizationTypeNone
- @text_field.borderStyle = UITextBorderStyleRoundedRect
- end
- def centered_within(view)
- @text_field.textAlignment = UITextAlignmentCenter
- @text_field.center = CGPointMake(view.frame.size.width / 2, view.frame.size.height / 2 - 100)
- self
- end
- def build
- @text_field
- end
-end