Class: When::CalendarNote::Week::DayOfWeek

Inherits:
BasicTypes::M17n show all
Defined in:
lib/when_exe/calendarnote.rb

Overview

暦週要素

Constant Summary

Constants inherited from BasicTypes::M17n

BasicTypes::M17n::AncientOrient, BasicTypes::M17n::Armenian, BasicTypes::M17n::Bahai, BasicTypes::M17n::Balinese, BasicTypes::M17n::Calendar, BasicTypes::M17n::CalendarFormats, BasicTypes::M17n::Chinese, BasicTypes::M17n::ChineseLuniSolarHoliday, BasicTypes::M17n::Christian, BasicTypes::M17n::Coptic, BasicTypes::M17n::Dee, BasicTypes::M17n::Discordian, BasicTypes::M17n::EpochEvents, BasicTypes::M17n::French, BasicTypes::M17n::Goddess, BasicTypes::M17n::HankeHenry, BasicTypes::M17n::HashProperty, BasicTypes::M17n::Indian, BasicTypes::M17n::InternationalFixed, BasicTypes::M17n::Iranian, BasicTypes::M17n::Islamic, BasicTypes::M17n::Japanese, BasicTypes::M17n::JapaneseHoliday, BasicTypes::M17n::Javanese, BasicTypes::M17n::Jewish, BasicTypes::M17n::LabelTypes, BasicTypes::M17n::Martian, BasicTypes::M17n::Pax, BasicTypes::M17n::Positivist, BasicTypes::M17n::Roman, BasicTypes::M17n::Shire, BasicTypes::M17n::Symmetry, BasicTypes::M17n::Thai, BasicTypes::M17n::Tibetan, BasicTypes::M17n::Tranquility, BasicTypes::M17n::VanishingLeprechaun, BasicTypes::M17n::Vietnamese, BasicTypes::M17n::WeekDate, BasicTypes::M17n::World, BasicTypes::M17n::WorldSeason, BasicTypes::M17n::Yerm, BasicTypes::M17n::Yi, BasicTypes::M17n::Zoroastrian

Constants included from Parts::Resource

Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIDecode, Parts::Resource::IRIDecodeTable, Parts::Resource::IRIEncode, Parts::Resource::IRIEncodeTable, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

Constants included from Locale

Locale::AKT, Locale::AKT_keys, Locale::ChineseParser, Locale::DateParser, Locale::DefaultAlias, Locale::DefaultNamespaces, Locale::DefaultUnification, Locale::DigitMap, Locale::DigitParser, Locale::EastAsiaCC, Locale::EasternParser, Locale::Escape, Locale::IAST, Locale::IASTR, Locale::IAST_K, Locale::IAST_K_keys, Locale::JapaneseParser, Locale::KoreanParser, Locale::Link, Locale::Locale_af, Locale::Locale_ar, Locale::Locale_az, Locale::Locale_bg, Locale::Locale_bn, Locale::Locale_bs, Locale::Locale_ca, Locale::Locale_cs, Locale::Locale_cy, Locale::Locale_da, Locale::Locale_de, Locale::Locale_de_AT, Locale::Locale_de_CH, Locale::Locale_el, Locale::Locale_en, Locale::Locale_en_AU, Locale::Locale_en_CA, Locale::Locale_en_GB, Locale::Locale_en_IE, Locale::Locale_en_IN, Locale::Locale_en_NZ, Locale::Locale_en_US, Locale::Locale_en_ZA, Locale::Locale_eo, Locale::Locale_es, Locale::Locale_es_419, Locale::Locale_es_AR, Locale::Locale_es_CL, Locale::Locale_es_CO, Locale::Locale_es_CR, Locale::Locale_es_EC, Locale::Locale_es_MX, Locale::Locale_es_PA, Locale::Locale_es_PE, Locale::Locale_es_US, Locale::Locale_es_VE, Locale::Locale_et, Locale::Locale_eu, Locale::Locale_fa, Locale::Locale_fi, Locale::Locale_fr, Locale::Locale_fr_CA, Locale::Locale_fr_CH, Locale::Locale_gl, Locale::Locale_he, Locale::Locale_hi, Locale::Locale_hi_IN, Locale::Locale_hr, Locale::Locale_hu, Locale::Locale_id, Locale::Locale_is, Locale::Locale_it, Locale::Locale_it_CH, Locale::Locale_ja, Locale::Locale_kn, Locale::Locale_ko, Locale::Locale_lo, Locale::Locale_lt, Locale::Locale_lv, Locale::Locale_mk, Locale::Locale_mn, Locale::Locale_ms, Locale::Locale_nb, Locale::Locale_ne, Locale::Locale_nl, Locale::Locale_nn, Locale::Locale_or, Locale::Locale_pl, Locale::Locale_pt, Locale::Locale_pt_BR, Locale::Locale_rm, Locale::Locale_ro, Locale::Locale_ru, Locale::Locale_sk, Locale::Locale_sl, Locale::Locale_sr, Locale::Locale_sv, Locale::Locale_sw, Locale::Locale_ta, Locale::Locale_th, Locale::Locale_tl, Locale::Locale_tr, Locale::Locale_uk, Locale::Locale_ur, Locale::Locale_uz, Locale::Locale_vi, Locale::Locale_wo, Locale::Locale_zh, Locale::Locale_zh_CN, Locale::Locale_zh_HK, Locale::Locale_zh_TW, Locale::Locale_zh_YUE, Locale::NUL, Locale::NumAlter1, Locale::NumAlter2, Locale::NumMap, Locale::NumRExp1, Locale::NumRExp3, Locale::NumRExp4, Locale::Numbers, Locale::Ref, Locale::RegExpEastAsia, Locale::TimeParser, Locale::WikipediaLinks

Instance Attribute Summary collapse

Attributes inherited from BasicTypes::M17n

#label

Attributes included from Parts::Resource

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

Attributes included from Locale

#keys, #link, #names, #values

Attributes inherited from BasicTypes::Code

#code_space

Instance Method Summary collapse

Methods inherited from BasicTypes::M17n

_label, label, #label_for_prefix, labels, month_name, #to_external_encoding, #to_internal_encoding, #to_m17n

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, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

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

Methods included from Parts::Resource::Synchronize

#synchronize

Methods included from Locale

#+, #=~, #[], _dbpedia, _get_locale, _hash_key, _hash_value, _locale, _method_missing, _namespace, #_printf, _setup_, _setup_info, _split, _split_with_rfc6868_escape, _to_date_time_hash, _unification, akt, #dbpedia, iast_akt, ideographic_unification, #ideographic_unification, #index, k2a_digits, method_missing, #prefix, #reference, #translate, translate, transliteration_keys, transliteration_keys_hash, #update, z2h_digits

Methods inherited from String

#^, #calendar, #calendar_era, #calendar_note, #clock, #encode, #era, #ideographic_unification, #m17n, #ord, #resource, #to_m17n, #to_month_name, #to_pair, #to_r, #to_residue, #translate, #when?

Methods included from EncodingConversion

#+@, #-@, #to_external_encoding, #to_internal_encoding

Dynamic Method Handling

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

Instance Attribute Details

#deltaInteger (readonly)

当該暦週要素の標準的な出現間隔

Returns:

  • (Integer)


743
744
745
# File 'lib/when_exe/calendarnote.rb', line 743

def delta
  @delta
end

Instance Method Details

#just_or_last(date) ⇒ When::TM::TemporalPosition

当日または直前に当該暦週要素が現れる日付

Returns:

Raises:

  • (ArgumentError)


757
758
759
760
761
762
763
764
765
766
767
768
# File 'lib/when_exe/calendarnote.rb', line 757

def just_or_last(date)
  date = week_note._to_date_for_note(date)
  ([parent.child.length, @delta[When::DAY]].max*2).times do
    if equal?(week_note.week(date)[:value])
       date.events ||= []
       date.events << self
       return date
    end
    date -= When::P1D
  end
  raise ArgumentError, "#{self} not found"
end

#week_noteWhen::CalendarNote

所属する暦週オブジェクト

Returns:



749
750
751
# File 'lib/when_exe/calendarnote.rb', line 749

def week_note
  @week_note ||= When.CalendarNote(iri.split('/Notes').first)
end