Sha256: 20033e23978eba2200b72406ab492ceb7beb1dab1f93b5785d3f9e9698358f5c
Contents?: true
Size: 1.21 KB
Versions: 2
Compression:
Stored size: 1.21 KB
Contents
--- !ruby/object:RI::MethodDescription aliases: [] block_params: (aliased_target, punctuation) comment: - !ruby/struct:SM::Flow::P body: "Encapsulates the common pattern of:" - !ruby/struct:SM::Flow::VERB body: " alias_method :foo_without_feature, :foo\n alias_method :foo, :foo_with_feature\n" - !ruby/struct:SM::Flow::P body: "With this, you simply do:" - !ruby/struct:SM::Flow::VERB body: " alias_method_chain :foo, :feature\n" - !ruby/struct:SM::Flow::P body: And both aliases are set up for you. - !ruby/struct:SM::Flow::P body: "Query and bang methods (foo?, foo!) keep the same punctuation:" - !ruby/struct:SM::Flow::VERB body: " alias_method_chain :foo?, :feature\n" - !ruby/struct:SM::Flow::P body: is equivalent to - !ruby/struct:SM::Flow::VERB body: " alias_method :foo_without_feature?, :foo?\n alias_method :foo?, :foo_with_feature?\n" - !ruby/struct:SM::Flow::P body: so you can safely chain foo, foo?, and foo! with the same feature. - !ruby/struct:SM::Flow::VERB body: " CREDIT: Bitsweat\n CREDIT: Rails Team\n" full_name: Module#alias_method_chain is_singleton: false name: alias_method_chain params: (target, feature) {|aliased_target, punctuation| ...} visibility: private
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
facets-2.4.2 | doc/ri/Module/alias_method_chain-i.yaml |
facets-2.4.3 | doc/ri/Module/alias_method_chain-i.yaml |