This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ProcessAsset | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def process_asset(asset_name) | |
define_method :process do | |
send "#{asset_name}_file_name" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def tap(method =nil, *params, &block) | |
block.call(self) if block | |
self.send(method, *params) if method | |
self | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def tap(method=nil, *params, &block) | |
raise ArgumentError, "supply either a block or a method name to send" if (method || block) && !(method && block) | |
block ||= proc { self.send method, *params } | |
super(&block) | |
end | |
end |