Created
November 9, 2014 10:10
-
-
Save agerwick/7c346b4554995c6b90cf to your computer and use it in GitHub Desktop.
Can't access methods within a Sinatra::Base class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
2.0.0-p353 :001 > require 'sinatra/base' | |
=> true | |
2.0.0-p353 :002 > class PlainClass | |
2.0.0-p353 :003?> def say_cheese | |
2.0.0-p353 :004?> "cheese" | |
2.0.0-p353 :005?> end | |
2.0.0-p353 :006?> end | |
=> nil | |
2.0.0-p353 :007 > class SinatraClass < Sinatra::Base | |
2.0.0-p353 :008?> def say_cheese | |
2.0.0-p353 :009?> "cheese" | |
2.0.0-p353 :010?> end | |
2.0.0-p353 :011?> end | |
=> nil | |
2.0.0-p353 :012 > PlainClass.new.say_cheese | |
=> "cheese" | |
2.0.0-p353 :013 > SinatraClass.new.say_cheese | |
NoMethodError: undefined method `say_cheese' for #<Sinatra::Wrapper:0x8e4061c> | |
from (irb):13 | |
from /home/raw/.rvm/rubies/ruby-2.0.0-p353/bin/irb:12:in `<main>' | |
2.0.0-p353 :014 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment