Class: When::CalendarTypes::CalendarNote::JapaneseNote::Notes

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

Overview

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

Constant Summary

Constants included from Parts::Resource

Parts::Resource::LabelProperty, Parts::Resource::Prefix, Parts::Resource::PrefixIndex, Parts::Resource::PrefixKeys, Parts::Resource::PrefixValues

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 inherited from BasicTypes::Object

#tap

Methods included from Parts::Resource

#[], #^, _extract_prefix, _instance, _parse, _path_with_prefix, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?

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)



262
263
264
# File 'lib/when_exe/region/japanese_notes.rb', line 262

def label
  @label
end

#positionObject (readonly)



262
263
264
# File 'lib/when_exe/region/japanese_notes.rb', line 262

def position
  @position
end

#suffixObject (readonly)



262
263
264
# File 'lib/when_exe/region/japanese_notes.rb', line 262

def suffix
  @suffix
end

Instance Method Details

#to_note_hash(note, dates = nil) ⇒ Object



265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/when_exe/region/japanese_notes.rb', line 265

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