Class: HttpObjects::Parameters::LanguageTags

Inherits:
BasicRules::Base show all
Defined in:
lib/http_objects/parameters/language_tags.rb

Overview

3.10 Language Tags Examples

en, en-US, en-cockney, i-cherokee, x-pig-latin

Instance Attribute Summary

Attributes inherited from BasicRules::Base

#raw, #value

Class Method Summary collapse

Methods inherited from BasicRules::Base

#initialize

Constructor Details

This class inherits a constructor from HttpObjects::Parameters::BasicRules::Base

Class Method Details

.parse(value) ⇒ Object



8
9
10
11
12
# File 'lib/http_objects/parameters/language_tags.rb', line 8

def self.parse(value)
  raw = value
  value = value.to_s.gsub(/(\s+)/, "").split(",")
  self.new(raw, value)
end