Class: Riddler::ContextBuilders::UserAgentDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Riddler::ContextBuilders::UserAgentDrop
- Defined in:
- lib/riddler/context_builders/user_agent.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#user_agent ⇒ Object
readonly
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(user_agent) ⇒ UserAgentDrop
constructor
A new instance of UserAgentDrop.
- #liquid_method_missing(method) ⇒ Object
- #method_missing(method, *_args) ⇒ Object
Constructor Details
#initialize(user_agent) ⇒ UserAgentDrop
Returns a new instance of UserAgentDrop.
18 19 20 21 |
# File 'lib/riddler/context_builders/user_agent.rb', line 18 def initialize user_agent @user_agent = user_agent @browser = Browser.new user_agent end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *_args) ⇒ Object
27 28 29 30 |
# File 'lib/riddler/context_builders/user_agent.rb', line 27 def method_missing method, *_args return super unless browser.respond_to? method liquid_method_missing method end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
16 17 18 |
# File 'lib/riddler/context_builders/user_agent.rb', line 16 def browser @browser end |
#user_agent ⇒ Object (readonly)
Returns the value of attribute user_agent.
16 17 18 |
# File 'lib/riddler/context_builders/user_agent.rb', line 16 def user_agent @user_agent end |
Instance Method Details
#liquid_method_missing(method) ⇒ Object
23 24 25 |
# File 'lib/riddler/context_builders/user_agent.rb', line 23 def liquid_method_missing method browser.public_send method end |