Skip to content

Commit

Permalink
Minor style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Aug 9, 2011
1 parent b2aecfc commit 1c592a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/virtus/attribute/default_value.rb
Expand Up @@ -44,7 +44,7 @@ def evaluate(instance)
callable? ? call(instance) : value
end

private
private

This comment has been minimized.

Copy link
@solnic

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

This comment has been minimized.

Copy link
@dkubb

dkubb Aug 9, 2011

Author 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.

This comment has been minimized.

Copy link
@solnic

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
#
Expand Down
2 changes: 1 addition & 1 deletion lib/virtus/coercion/time_coercions.rb
Expand Up @@ -60,7 +60,7 @@ def to_date(value)
coerce_with_method(value, :to_date)
end

private
private

# Try to use native coercion method on the given value
#
Expand Down

0 comments on commit 1c592a5

Please sign in to comment.