Skip to content

Commit

Permalink
Remove commented out code from core.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
smoil committed Mar 10, 2012
1 parent 8fdd3f8 commit 727c833
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
5 changes: 0 additions & 5 deletions lib/in_format/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ def in_format(attribute, opts = {})

if opts[:setter]
if opts[:use_accessor]
# alias_method "_#{attribute}=".to_sym, "#{attribute}=".to_sym
original_setter = self.instance_method("#{attribute}=")

define_method("#{attribute}=") do |value|
# self.send "_#{attribute}=", opts[:setter].call(value)
original_setter.bind(self).call(opts[:setter].call(value))
end
else
Expand All @@ -20,15 +18,12 @@ def in_format(attribute, opts = {})

if opts[:getter]
if opts[:use_accessor]
# alias_method "_#{attribute}".to_sym, "#{attribute}".to_sym
original_getter = self.instance_method(attribute)

define_method("#{attribute}") do |raw = false|
if raw
# self.send "_#{attribute}"
original_getter.bind(self).call
else
# opts[:getter].call(self.send "_#{attribute}")
opts[:getter].call(original_getter.bind(self).call)
end
end
Expand Down
25 changes: 0 additions & 25 deletions spec/alias_option_spec.rb

This file was deleted.

0 comments on commit 727c833

Please sign in to comment.