Class: TwitterCldr::Resources::Units

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/resources/units_importer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale, cldr_req) ⇒ Units

Returns a new instance of Units.



65
66
67
68
# File 'lib/twitter_cldr/resources/units_importer.rb', line 65

def initialize(locale, cldr_req)
  @locale = locale
  @cldr_req = cldr_req
end

Instance Attribute Details

#cldr_reqObject (readonly)

Returns the value of attribute cldr_req.



63
64
65
# File 'lib/twitter_cldr/resources/units_importer.rb', line 63

def cldr_req
  @cldr_req
end

#localeObject (readonly)

Returns the value of attribute locale.



63
64
65
# File 'lib/twitter_cldr/resources/units_importer.rb', line 63

def locale
  @locale
end

Instance Method Details

#to_hObject



70
71
72
73
74
75
76
77
# File 'lib/twitter_cldr/resources/units_importer.rb', line 70

def to_h
  {
    units: {
      unitLength: unit_length,
      durationUnit: duration_unit
    }
  }
end