Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equalizer causes “Undocumentable mixin” warning in YARD #19

Open
sferik opened this issue Feb 27, 2015 · 3 comments
Open

Equalizer causes “Undocumentable mixin” warning in YARD #19

sferik opened this issue Feb 27, 2015 · 3 comments

Comments

@sferik
Copy link
Collaborator

sferik commented Feb 27, 2015

When using Equalizer in projects that use YARD for documentation, YARD raises a YARD::Parser::UndocumentableError on every line that mixes-in Equalizer.

I’m not sure exactly how to solve this problem. Maybe I should just silence the warnings in YARD or maybe Equalizer should change its interface to mix-in a static module and then use class methods to define which attributes to use for equality. For example:

class GeoLocation
  include Equalizer
  attr_reader :latitude, :longitude
  equalize :latitude, :longitude

  def initialize(latitude, longitude)
    @latitude, @longitude = latitude, longitude
  end
end

I’m interested to have some discussion around this issue.

/cc @lsegal

@solnic
Copy link
Collaborator

solnic commented Apr 29, 2015

Personally I was thinking about switching to include SomeModule(:foo, :bar) which shouldn't cause this error (I think?).

In general one drawback with module subclasses is that it doesn't work in RubyMotion; other than that it's a sweet technique ;)

@sferik
Copy link
Collaborator Author

sferik commented Apr 29, 2015

Is RubyMotion a supported platform? I didn’t see it in the list of supported Ruby versions?

@solnic
Copy link
Collaborator

solnic commented Apr 29, 2015

It is not. Unless something changed and RM supports subclassing modules now. Then we could support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants