summaryrefslogtreecommitdiff
path: root/lib/hashie/extensions/method_access.rb
Commit message (Collapse)AuthorAgeFilesLines
* Change rubocop to allow 100 character lines.Bobby McDonald2019-10-171-2/+5
| | | | | For accessibility reasons, we should limit our lines to 100 chars max. https://github.com/slack-ruby/slack-ruby-client/pull/293#discussion_r309472083
* Add MethodOverridingInitializer extensionLucas Nestor2018-08-111-11/+43
|
* Update Rubocop and address the addressable todosMichael Herold2018-06-171-6/+4
| | | | | | | | | | | | | | | | | | | | | This is a big step forward in our Rubocop setup. I addressed all of the todos from the current version of Rubocop that made sense to. The only things that remain are metrics and one cop that relies on the line length metric to work. I made some judgment calls on disabling a few cops: 1. The `Layout/IndentHeredoc` cop wants you to either use the squiggly heredoc from Ruby 2.3 or introduce a library. Since we are a low-level library that is used as a transitive dependency, we cannot introduce another library as a dependence, so that option is out. Also, we support Rubies back to 2.0 currently, so using the squiggly heredoc isn't an option. Once we remove support for Rubies older than 2.3, we can switch to the squiggly heredoc cop. 2. The `Naming/FileName` cop was reporting false positives for a few files in the repository, so I disabled it on those files. 3. The `Style/DoubleNegation` cop reports lints on a few cases where we use double negation. Given the very generic nature of Hashie, the double-negation is the easiest, clearest way to express that we want an item to be a Boolean. I disabled the cop because we exist in the gray area where this makes sense.
* Ensure that MethodQuery methods return booleans.Michael Herold2015-10-251-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation about the MethodQuery module spells out the expected behavior. While the spec suite appeared to be testing the same, the RSpec matchers were not actually checking the behavior properly. This lead to a divergence between the expected behavior, as outlined in the module documentation, and the actual behavior, as tested in the spec suite. This is the reason that #299 is happening: the expected behavior is not the actual behavior. I have included a test for #299 to show that it works as expected in this branch. This change makes the spec suite match the behavior in the module documentation, then modifies the methods to match the documentated specification. Lastly, I took the time to clean up the MethodQuery module for two reasons: 1. The old implementation used Regexps on the stringified method names, which is unnecessary since we have the wonderful `String#end_with?` method to check the suffix of a strings. 2. The old logic was difficult to reason through, so I clarified the intent of the methods by reducing the complexity of the conditionals and extracting meaningful methods where possible.
* Refactor MethodReader#method_missingZloy2015-01-191-6/+12
|
* Methods such as abc? return true/false Hashie::Extensions::MethodReader.Zloy2015-01-141-0/+4
|
* Merging Hashie::Mash now correctly only calls the block on duplicate valuesAmy Sutedja2014-09-051-1/+1
|
* Add Hashie::Extensions::MethodOverridingWriterMichael Herold2014-08-201-0/+75
| | | | This is part 2 of 3 of the to-do list determined in #198.
* Added Rubocop.dblock2014-03-301-9/+9
|
* Revert "Revert "Merge pull request #62 from dlupu/master""Jerry Cheung2013-02-121-3/+3
| | | | This reverts commit 6af738f3984a644372266ac6d4b7557cbdf040e1.
* Revert "Merge pull request #62 from dlupu/master"Jerry Cheung2013-02-111-3/+3
| | | | | This reverts commit 419446a77b566140f2eb2257aa9db97d2d15ead6, reversing changes made to fec979fe5af1a4dd214eb6f2cd24182d21f81013.
* fix typo from previous commitDorian LUPU2012-11-021-3/+3
|
* enhance Hashie::Extensions::MethodReader#respond_to?, ↵Dorian LUPU2012-11-021-3/+3
| | | | Hashie::Extensions::MethodWriter#respond_to? and Hashie::Extensions::MethodQuery#respond_to? so that it supports the optional include_private argument - needed to work properly with some other modules like ActiveModel::Validations
* Adds MethodWriter and MethodQuery extensions.Michael Bleigh2011-08-021-0/+63
|
* Adds stubs for future extensions, adds implementation for MethodReader ↵Michael Bleigh2011-08-011-0/+61
extension.