Class: Pipl::Language
Instance Attribute Summary collapse
-
#display ⇒ Object
Returns the value of attribute display.
-
#language ⇒ Object
Returns the value of attribute language.
-
#region ⇒ Object
Returns the value of attribute region.
Attributes inherited from Field
#current, #inferred, #last_seen, #valid_since
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Language
constructor
A new instance of Language.
- #to_s ⇒ Object
Methods inherited from Field
base_params_from_hash, extra_metadata, from_hash, #is_searchable?, #to_hash
Methods included from Utils
alnum_chars, alpha_chars, date_to_str, extract_rate_limits, is_valid_url?, str_to_date, titleize, to_utf8
Constructor Details
#initialize(params = {}) ⇒ Language
Returns a new instance of Language.
634 635 636 637 638 639 |
# File 'lib/pipl/fields.rb', line 634 def initialize(params={}) super params @language = params[:language] @region = params[:region] @display = params[:display] end |
Instance Attribute Details
#display ⇒ Object
Returns the value of attribute display.
632 633 634 |
# File 'lib/pipl/fields.rb', line 632 def display @display end |
#language ⇒ Object
Returns the value of attribute language.
632 633 634 |
# File 'lib/pipl/fields.rb', line 632 def language @language end |
#region ⇒ Object
Returns the value of attribute region.
632 633 634 |
# File 'lib/pipl/fields.rb', line 632 def region @region end |
Instance Method Details
#to_s ⇒ Object
641 642 643 644 645 646 |
# File 'lib/pipl/fields.rb', line 641 def to_s return @display if @display return "#{@language}_#{@region}" if @language && @region return @language if @language && ! @language.empty? @region end |