Module: RubyNative::NativeDetection
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/ruby_native/native_detection.rb
Instance Method Summary collapse
Instance Method Details
#native_app? ⇒ Boolean
9 10 11 |
# File 'lib/ruby_native/native_detection.rb', line 9 def native_app? request.user_agent.to_s.include?("Ruby Native") end |
#native_version ⇒ Object
13 14 15 16 |
# File 'lib/ruby_native/native_detection.rb', line 13 def native_version match = request.user_agent.to_s.match(/RubyNative\/([\d.]+)/) NativeVersion.new(match ? match[1] : "0") end |