Undefined method 'then'
bshyong opened this issue · 2 comments
1.9.3-p448 :011 > protocol = exp.start("http").maybe("s").with("://")
=> ^http(?:s)?://
1.9.3-p448 :012 > domain = exp.find { words }
=> ^http(?:s)?://((?:\w)+)
1.9.3-p448 :013 > tld = exp.then(".").either("org", "com", "net")
NoMethodError: undefined method `then' for ^http(?:s)?://((?:\w)+):Hexpress
any idea what I'm doing wrong here?
Oops. Needed to require the web library.
`require "hexpress/web"``
[EDIT]
need to require verbal_expression
require 'verbal_expression'
See below
You're doing nothing wrong, it's only that I've moved then
to the
VerbalExpression spec. See, VerExp uses Then where we use With. With
require 'verbal_expression'
we match the verbal expression spec.
The reason I've removed then
from the default hexpress method list is
because it's also a ruby keyword and I'd like to avoid confusion.
On Tue, Sep 10, 2013 at 8:54 AM, Ben notifications@github.com wrote:
1.9.3-p448 :011 > protocol = exp.start("http").maybe("s").with("://")
=> ^http(?:s)?://
1.9.3-p448 :012 > domain = exp.find { words }
=> ^http(?:s)?://((?:\w)+)
1.9.3-p448 :013 > tld = exp.then(".").either("org", "com", "net")
NoMethodError: undefined method `then' for ^http(?:s)?://((?:\w)+):Hexpressany idea what I'm doing wrong here?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4
.
Kurtis Rainbolt-Greene, Hacker
Software Developer
612 S. Flower St.
Los Angeles, CA, 90017