SnakeCase
For RubyMotion developers who are a fan of snake_case. Converting to snake_case, one API at a time.\n\nSlowly converting any API I use to snake_case or to a more idiomatic way of doing it. Lots of monkey patching, because RUBY!
Installation
Add this line to your application's Gemfile:
gem 'snake_case'
And then execute:
$ bundle
Or install it yourself as:
$ gem install snake_case
Usage
This is just a reference for each class I've added methods to. Good to check out the actual source code and specs.
UIView
view = UIView.create
view = UIView.create do |v|
v.frame = [[10, 10], [10, 10]]
end
view << UIView.new
view.top
view.top = 20
view.top
view.frame.origin.y
view.left
view.left = 20
view.left
view.frame.origin.x
view.bottom
view.bottom = 30
view.top
view.bottom
view.right
view.right = 30
view.left
view.right
view.width
view.width = 20
view.width
view.height
view.height = 20
view.height
view.corner_radius = 5
view.corner_radius
view.layer.cornerRadius
view.border_radius = 10
view.border_radius
view.corner_radius
view.layer.cornerRadius
view.border_width = 15
view.border_width
view.layer.borderWidth
view.border_color = UIColor.greenColor
view.border_color
view.layer.borderColor
view.size_to_fit
view.redisplay
view.set_needs_display
view.background_color
view.background_color=
Contributing
- Fork it ( http://github.com/FluffyJack/snake_case/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request