Class: UniProp::PropertyData
- Inherits:
-
Object
- Object
- UniProp::PropertyData
- Defined in:
- lib/uniprop/metadata_processor.rb
Instance Attribute Summary collapse
-
#positions ⇒ Object
readonly
Returns the value of attribute positions.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(property, positions, unihan, derived) ⇒ PropertyData
constructor
プロパティメタデータに含まれる、プロパティ1つあたりのデータ.
- #is_derived? ⇒ Boolean
- #is_unihan? ⇒ Boolean
-
#position ⇒ Position
プロパティの解析に最も適したPositionオブジェクトをを取得.
-
#property_value_group ⇒ PropertyValueGroup/UnihanValueGroup
propertyの情報を取得するのに最適なPropertyValueGroupオブジェクトを生成.
- #type ⇒ Object
Constructor Details
#initialize(property, positions, unihan, derived) ⇒ PropertyData
プロパティメタデータに含まれる、プロパティ1つあたりのデータ
628 629 630 631 632 633 634 |
# File 'lib/uniprop/metadata_processor.rb', line 628 def initialize(property, positions, unihan, derived) @property = property @version = @property.version @positions = positions @unihan = unihan @derived = derived end |
Instance Attribute Details
#positions ⇒ Object (readonly)
Returns the value of attribute positions.
621 622 623 |
# File 'lib/uniprop/metadata_processor.rb', line 621 def positions @positions end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
621 622 623 |
# File 'lib/uniprop/metadata_processor.rb', line 621 def property @property end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
621 622 623 |
# File 'lib/uniprop/metadata_processor.rb', line 621 def version @version end |
Instance Method Details
#is_derived? ⇒ Boolean
640 641 642 |
# File 'lib/uniprop/metadata_processor.rb', line 640 def is_derived? @derived end |
#is_unihan? ⇒ Boolean
636 637 638 |
# File 'lib/uniprop/metadata_processor.rb', line 636 def is_unihan? @unihan end |
#position ⇒ Position
プロパティの解析に最も適したPositionオブジェクトをを取得
650 651 652 653 654 655 656 657 658 659 |
# File 'lib/uniprop/metadata_processor.rb', line 650 def position if is_derived? # Derivedファイルが存在する場合、使用 return positions.find { _1.propfile.basename_prefix=~/Derived/ } else # Derivedファイルが存在しない場合、 # 記述される列が最も小さいファイルが解析しやすいため使用 return positions.sort { _1.columns.size }.first end end |
#property_value_group ⇒ PropertyValueGroup/UnihanValueGroup
propertyの情報を取得するのに最適なPropertyValueGroupオブジェクトを生成
663 664 665 666 667 668 669 670 671 |
# File 'lib/uniprop/metadata_processor.rb', line 663 def property_value_group return @property_value_group if @property_value_group if is_unihan? @property_value_group = version.unihanprop.unihan_value_group(property) else @property_value_group = PropertyValueGroup.new(position.propfile, property, position.block) end end |
#type ⇒ Object
644 645 646 |
# File 'lib/uniprop/metadata_processor.rb', line 644 def type property.property_value_type end |