Class: When::CalendarNote::Japanese::Note

Inherits:
NoteElement show all
Defined in:
lib/when_exe/region/japanese/notes.rb,
lib/when_exe/region/japanese/notes.rb

Overview

日本暦注用の Notes の要素のための内部クラス

Constant Summary

Constants included from Parts::Resource

Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty

Instance Attribute Summary collapse

Attributes included from Parts::Resource

#_pool, #child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods inherited from NoteElement

#_to_hash_value

Methods included from Parts::Resource

#[], #^, _abbreviation_to_iri, _decode, _encode, _extract_prefix, _instance, _instantiate, _parse, _path_with_prefix, _replace_tags, _setup_, _setup_info, _simplify_path, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_pool, #_setup_, #pool_keys

Methods included from Parts::Resource::Synchronize

#synchronize

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



388
389
390
# File 'lib/when_exe/region/japanese/notes.rb', line 388

def label
  @label
end

#positionObject (readonly)

Returns the value of attribute position.



388
389
390
# File 'lib/when_exe/region/japanese/notes.rb', line 388

def position
  @position
end

#suffixObject (readonly)

Returns the value of attribute suffix.



388
389
390
# File 'lib/when_exe/region/japanese/notes.rb', line 388

def suffix
  @suffix
end

Instance Method Details

#to_note_hash(note, dates = nil) ⇒ Object



390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/when_exe/region/japanese/notes.rb', line 390

def to_note_hash(note, dates=nil)
  {
    :note      => self,
    :value     => case @suffix
                  when '' ; [@label + '是-', note[/.$/]]
                  when '' ; [@label + '在-', note]
                  when '-'  ; [@label + '-',   note]
                  else      ; note
                  end,
    :position => @position[@position.size == 1 ? 0 : dates.index_g]
  }
end