I have a Book < LibraryItem
and a Book::Page, which is defined as
class Book
class Page
in models/book/page.rb
LibraryItem has a method called can_edit?
But my Book::Page.new.can_edit? returns no method error…
how do I include the instance methods from LibraryItem in my namespace?
This returns an error because
Pagedoes not have acan_edit?method. ABookhas aPageclass, butPageis not a subclass ofLibraryitem (onlyBookis). Socan_edit?is valid forBookbut not forPage.Try
And you will get
Object