Class: Algolia::UserAgent
- Inherits:
-
Object
- Object
- Algolia::UserAgent
- Defined in:
- lib/algolia/user_agent.rb
Constant Summary collapse
- @@value =
Defaults::USER_AGENT
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
-
.add(segment, version) ⇒ Object
Adds a segment to the UserAgent.
-
.reset_to_default ⇒ Object
Resets the value of the UserAgent.
-
.value ⇒ Object
Set the value of the UserAgent.
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/algolia/user_agent.rb', line 3 def value @value end |
Class Method Details
.add(segment, version) ⇒ Object
Adds a segment to the UserAgent
21 22 23 |
# File 'lib/algolia/user_agent.rb', line 21 def self.add(segment, version) @@value += format('; %<segment>s (%<version>s)', segment: segment, version: version) end |
.reset_to_default ⇒ Object
Resets the value of the UserAgent
15 16 17 |
# File 'lib/algolia/user_agent.rb', line 15 def self.reset_to_default @@value = Defaults::USER_AGENT end |
.value ⇒ Object
Set the value of the UserAgent
9 10 11 |
# File 'lib/algolia/user_agent.rb', line 9 def self.value @@value end |