Class: TwitterCldr::Shared::PropertySet

Inherits:
Object
  • Object
show all
Extended by:
SingleForwardable
Includes:
Properties, AdditionalPropertyMethods
Defined in:
lib/twitter_cldr/shared/property_set.rb

Defined Under Namespace

Modules: AdditionalPropertyMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties_hash) ⇒ PropertySet

Returns a new instance of PropertySet.



18
19
20
# File 'lib/twitter_cldr/shared/property_set.rb', line 18

def initialize(properties_hash)
  @properties_hash = properties_hash
end

Instance Attribute Details

#properties_hashObject (readonly)

Returns the value of attribute properties_hash.



14
15
16
# File 'lib/twitter_cldr/shared/property_set.rb', line 14

def properties_hash
  @properties_hash
end

Instance Method Details

#ageObject



22
23
24
# File 'lib/twitter_cldr/shared/property_set.rb', line 22

def age
  properties_hash.fetch('Age', ['Unassigned'])
end

#bidi_paired_bracket_typeObject



36
37
38
39
40
# File 'lib/twitter_cldr/shared/property_set.rb', line 36

def bidi_paired_bracket_type
  properties_hash['Bidi_Paired_Bracket_Type'] ||= [
    BidiBrackets.bracket_types['N']
  ]
end

#blockObject



42
43
44
# File 'lib/twitter_cldr/shared/property_set.rb', line 42

def block
  properties_hash['Block'] ||= ['No_Block']
end

#east_asian_widthObject



46
47
48
# File 'lib/twitter_cldr/shared/property_set.rb', line 46

def east_asian_width
  properties_hash['East_Asian_Width'] ||= ['N']
end

#general_categoryObject



74
75
76
# File 'lib/twitter_cldr/shared/property_set.rb', line 74

def general_category
  properties_hash.fetch('General_Category', [])
end

#grapheme_cluster_breakObject



50
51
52
# File 'lib/twitter_cldr/shared/property_set.rb', line 50

def grapheme_cluster_break
  properties_hash['Grapheme_Cluster_Break'] ||= ['Other']
end

#hangul_syllable_typeObject



54
55
56
# File 'lib/twitter_cldr/shared/property_set.rb', line 54

def hangul_syllable_type
  properties_hash['Hangul_Syllable_Type'] ||= ['Not_Applicable']
end

#indic_positional_categoryObject



58
59
60
# File 'lib/twitter_cldr/shared/property_set.rb', line 58

def indic_positional_category
  properties_hash['Indic_Positional_Category'] ||= ['NA']
end

#indic_syllabic_categoryObject



62
63
64
# File 'lib/twitter_cldr/shared/property_set.rb', line 62

def indic_syllabic_category
  properties_hash['Indic_Syllabic_Category'] ||= ['Other']
end

#jamo_short_nameObject



66
67
68
# File 'lib/twitter_cldr/shared/property_set.rb', line 66

def jamo_short_name
  properties_hash['Jamo_Short_Name'] ||= ['<none>']
end

#joining_typeObject



26
27
28
29
30
31
32
33
34
# File 'lib/twitter_cldr/shared/property_set.rb', line 26

def joining_type
  properties_hash['Joining_Type'] ||= if general_category.empty?
    [ArabicShaping.joining_type_for_general_category('xx')]
  else
    general_category.map do |gc|
      ArabicShaping.joining_type_for_general_category(gc)
    end
  end
end

#line_breakObject



70
71
72
# File 'lib/twitter_cldr/shared/property_set.rb', line 70

def line_break
  properties_hash['Line_Break'] ||= ['XX']
end

#scriptObject



82
83
84
# File 'lib/twitter_cldr/shared/property_set.rb', line 82

def script
  properties_hash['Script'] ||= ['Unknown']
end

#script_extensionsObject



78
79
80
# File 'lib/twitter_cldr/shared/property_set.rb', line 78

def script_extensions
  properties_hash['Script_Extensions'] ||= ['<script>']
end

#sentence_breakObject



86
87
88
# File 'lib/twitter_cldr/shared/property_set.rb', line 86

def sentence_break
  properties_hash['Sentence_Break'] ||= ['Other']
end

#word_breakObject



90
91
92
# File 'lib/twitter_cldr/shared/property_set.rb', line 90

def word_break
  properties_hash['Word_Break'] ||= ['Other']
end