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

Static Undefined Method #22

Closed
tobymao opened this issue Mar 15, 2015 · 3 comments
Closed

Static Undefined Method #22

tobymao opened this issue Mar 15, 2015 · 3 comments

Comments

@tobymao
Copy link

tobymao commented Mar 15, 2015

The static method only seems to work if a super class defines it.

For example,
Views:: Base
def main
end

Views::Layouts::Page < Views::Base
static :main
static :intro

def main
end

def intro
end

This will result in undefined method `intro'

@tobymao
Copy link
Author

tobymao commented Mar 15, 2015

I see, that it works if static is called after the definition. Maybe I was just using this feature incorrectly.

@ageweke
Copy link
Owner

ageweke commented Mar 17, 2015

That’s correct; the method does have to be defined before you can invoke static on it.

I’m actively writing documentation for Fortitude these days, and this will definitely be one of the things I will include in it. (In fact, I’m just impressed you got that feature working at all with no documentation whatsoever!)

@ageweke ageweke closed this as completed Mar 17, 2015
@ageweke
Copy link
Owner

ageweke commented Oct 2, 2015

Reopening this until I can improve it, at least a little. At bare minimum, I could add more detail to the error message saying that static declarations need to go after the method definition, not before it…

@ageweke ageweke reopened this Oct 2, 2015
@ageweke ageweke closed this as completed in 4a5a9cf Oct 6, 2015
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