Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update incorrect incorrect require path shown in documentation that indicates ... #46

Merged
merged 1 commit into from

2 participants

@msavy

...cattr when it ought to be mattr.

irb(main):008:0> require 'facets/module/cattr'
LoadError: no such file to load -- facets/module/cattr

irb(main):012:0> require 'facets/module/mattr'
=> true
@trans
Owner

Thanks for this patch, however module/cattr should exist. So I fixed that. This is one of those methods that's grouped with a number of other closely related methods and I try to offer all obvious ways to require them.

However I should point out that the cattr methods are a bit frowned upon these days for their use of class variables, so I have considered moving this to a standard library instead, loadable via facets/cattr. Would appreciate input on this idea.

@trans trans merged commit 0ce3d70 into rubyworks:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 6, 2012
  1. @msavy

    Update incorrect incorrect require path in documentation that indicat…

    msavy authored
    …es `cattr` when it ought to be `mattr`.
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/core/facets/module/mattr.rb
View
16 lib/core/facets/module/mattr.rb
@@ -17,7 +17,7 @@ class Module
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def cattr(*syms)
writers, readers = syms.flatten.partition{ |a| a.to_s =~ /=$/ }
@@ -47,7 +47,7 @@ def cattr(*syms)
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def cattr_reader(*syms)
syms.flatten.each do |sym|
@@ -89,7 +89,7 @@ def #{sym}
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def cattr_writer(*syms)
syms.flatten.each do |sym|
@@ -128,7 +128,7 @@ def #{sym}=(obj)
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def cattr_accessor(*syms)
cattr_reader(*syms) + cattr_writer(*syms)
@@ -157,7 +157,7 @@ def cattr_accessor(*syms)
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def mattr(*syms)
writers, readers = syms.flatten.partition{ |a| a.to_s =~ /=$/ }
@@ -187,7 +187,7 @@ def mattr(*syms)
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def mattr_reader( *syms )
syms.flatten.each do |sym|
@@ -230,7 +230,7 @@ def #{sym}
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def mattr_writer(*syms)
syms.flatten.each do |sym|
@@ -270,7 +270,7 @@ def #{sym}=(obj)
# CREDIT: David Heinemeier Hansson
#
# @uncommon
- # require 'facets/module/cattr'
+ # require 'facets/module/mattr'
#
def mattr_accessor(*syms)
mattr_reader(*syms) + mattr_writer(*syms)
Something went wrong with that request. Please try again.