Module: Hashie::Extensions::RubyVersionCheck::ClassMethods

Defined in:
lib/hashie/extensions/ruby_version_check.rb

Instance Method Summary collapse

Instance Method Details

#with_minimum_ruby(version) ⇒ Object


11
12
13
# File 'lib/hashie/extensions/ruby_version_check.rb', line 11

def with_minimum_ruby(version)
  yield if with_minimum_ruby?(version)
end

#with_minimum_ruby?(version) ⇒ Boolean

Returns:

  • (Boolean)

15
16
17
# File 'lib/hashie/extensions/ruby_version_check.rb', line 15

def with_minimum_ruby?(version)
  RubyVersion.new(RUBY_VERSION) >= RubyVersion.new(version)
end