Skip to content

Commit

Permalink
Merge pull request #99 from create-renegr/pleasedonotremovecorefunctions
Browse files Browse the repository at this point in the history
Supporting hash indexing with Flexirest instances
  • Loading branch information
andyjeffries committed Aug 5, 2018
2 parents 9474b39 + f7d5729 commit 09ce13f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: ruby
rvm:
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.2
Expand Down
2 changes: 1 addition & 1 deletion lib/flexirest/base_without_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BaseWithoutValidation
attr_accessor :_headers

instance_methods.each do |m|
next unless %w{display presence load require hash untrust trust freeze method enable_warnings with_warnings suppress capture silence quietly debugger breakpoint}.map(&:to_sym).include? m
next unless %w{display presence load require untrust trust freeze method enable_warnings with_warnings suppress capture silence quietly debugger breakpoint}.map(&:to_sym).include? m
undef_method m
end

Expand Down
12 changes: 12 additions & 0 deletions spec/lib/ruby_core_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'spec_helper'

class EmptyExample < Flexirest::BaseWithoutValidation
whiny_missing true
end

describe Flexirest::BaseWithoutValidation do
it 'should support hash resolving' do
h = {}
expect{ h[EmptyExample.new] = 'not important' }.to_not raise_error
end
end

0 comments on commit 09ce13f

Please sign in to comment.