Skip to content

Commit

Permalink
Simplify constant definition method.
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Apr 28, 2011
1 parent ee594b8 commit dd56975
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/gir_ffi/builder_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ def const_defined_for parent, name
end end


def optionally_define_constant parent, name def optionally_define_constant parent, name
unless const_defined_for parent, name if const_defined_for parent, name
parent.const_set name, yield parent.const_get name
else
parent.const_set name, yield
end end
parent.const_get name
end end


end end
Expand Down

0 comments on commit dd56975

Please sign in to comment.