Skip to content

Commit

Permalink
a little nicer syntax, less emphasis on the condition
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronLasseigne committed Apr 30, 2014
1 parent f4b843b commit a655284
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/active_interaction/grouped_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ module ActiveInteraction
#
# @private
class GroupedInput < OpenStruct
unless method_defined?(:[])
def [](name)
send(name)
end
end
def [](name)
send(name)
end unless method_defined?(:[])

unless method_defined?(:[]=)
def []=(name, value)
send("#{name}=", value)
end
end
def []=(name, value)
send("#{name}=", value)
end unless method_defined?(:[]=)
end
end

1 comment on commit a655284

@tfausak
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.