Browse files

Minor style fix

  • Loading branch information...
1 parent b2aecfc commit 1c592a5160108e1802a100c3959654bfdc31378b @dkubb dkubb committed Aug 9, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/virtus/attribute/default_value.rb
  2. +1 −1 lib/virtus/coercion/time_coercions.rb
@@ -44,7 +44,7 @@ def evaluate(instance)
callable? ? call(instance) : value
- private
+ private
solnic Aug 9, 2011 Owner

what's up with this indentation? I use the same column cause my vim indents like that...I've never seen this style before hmmm

dkubb Aug 9, 2011 Collaborator

Oh, that was the style I've been using in veritas, and all throughout virtus already. I was just bringing it up to be consistent with the other code.

I've tried different styles of indenting the private and protected keywords. One was keeping it inline, like vim does. Another was indenting all the methods in the non-public scopes. I don't think there's a strong consensus in the ruby community yet.

I settled on this one because I can more easily identify the sections through a visual scan than I can when they are indented. The keywords tend to blend in with the method definitions and it is more difficult to see where the different scopes are. I find the style similar to how rescue and ensure keywords are used in methods, and how it stands out compared to normal code.

solnic Aug 10, 2011 Owner

fair enough. I need to figure out a way to configure vim to make that special indent

# Evaluates a proc value
@@ -60,7 +60,7 @@ def to_date(value)
coerce_with_method(value, :to_date)
- private
+ private
# Try to use native coercion method on the given value

0 comments on commit 1c592a5

Please sign in to comment.