| title | Super Secret Methods |
|---|---|
| layout | post |
| date | 2017-07-16 |
| snippet_source | code/super_secret_methods.rb |
Here is a quirk of the Ruby language that I discovered a few weeks ago.
Method names can not contain a period character.
| title | Super Secret Methods |
|---|---|
| layout | post |
| date | 2017-07-16 |
| snippet_source | code/super_secret_methods.rb |
Here is a quirk of the Ruby language that I discovered a few weeks ago.
Method names can not contain a period character.
When I do puts method_name inside #respond_to_missing?, it outputs begin,
so it looks like it's treating self as if it were a Range.
This is the RSpec output:
An error occurred while loading ./spec/value_semantics_spec.rb.
Failure/Error: first_letter = method_name[self]
SystemStackError:
stack level too deep
| # Schema: entries[ id, account_id, creator_id, created_at, updated_at, specialization_type, specialization_id ] | |
| class Entry < ApplicationRecord | |
| has_specialization types: %w[ Message Comment ] | |
| belongs_to :account | |
| belongs_to :creator | |
| end | |
| # Schema: messages[ id, subject ] | |
| class Message < ApplicationRecord | |
| is_specialization_of 'Entry' |
| Running test/automated/zettel/hashtag_query.rb | |
| Zettel::HashtagQuery | |
| matches the presence of a hashtag | |
| with syntax: #a | |
| provides logical NOT | |
| with syntax: NOT #a | |
| with syntax: not #a | |
| with syntax: !#a | |
| provides logical AND | |
| with syntax: #a AND #b |
| Mutant environment: | |
| Matcher: #<Mutant::Matcher::Config match_expressions: [C]> | |
| Integration: rspec | |
| Jobs: 8 | |
| Includes: [] | |
| Requires: ["./c"] | |
| Subjects: 1 | |
| Total-Tests: 90 | |
| Selected-Tests: 1 | |
| Tests/Subject: 1.00 avg |
| require 'json' | |
| COLORS = { | |
| '#' => '#216e39', | |
| '+' => '#30a14e', | |
| ':' => '#40c463', | |
| '-' => '#9be9a8', | |
| '.' => '#ebedf0', | |
| ' ' => nil, | |
| } |
I hereby claim:
To claim this, I am signing this object: