Class: TwitterCldr::Resources::CldrDTD

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

Defined Under Namespace

Classes: Attr

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cldr_requirement) ⇒ CldrDTD

Returns a new instance of CldrDTD.



81
82
83
# File 'lib/twitter_cldr/resources/cldr_dtd.rb', line 81

def initialize(cldr_requirement)
  @cldr_requirement = cldr_requirement
end

Instance Attribute Details

#cldr_requirementObject (readonly)

Returns the value of attribute cldr_requirement.



79
80
81
# File 'lib/twitter_cldr/resources/cldr_dtd.rb', line 79

def cldr_requirement
  @cldr_requirement
end

Instance Method Details

#find_attr(element_name, attr_name) ⇒ Object



85
86
87
88
89
90
# File 'lib/twitter_cldr/resources/cldr_dtd.rb', line 85

def find_attr(element_name, attr_name)
  elements[element_name] ||= {}
  elements[element_name][attr_name] ||= Attr.new(
    attr_name, element_name, self
  )
end

#schemaObject



92
93
94
# File 'lib/twitter_cldr/resources/cldr_dtd.rb', line 92

def schema
  @schema ||= File.read(schema_path).split("\n")
end