Class: Zakuro::Operation::MonthHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/zakuro/operation/month/type.rb

Overview

MonthHistory 変更履歴

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: '', parent_id: '', reference: Reference.new, western_date: Western::Calendar.new, annotations: [], diffs: Diffs.new) ⇒ MonthHistory

初期化

Parameters:

  • id (String) (defaults to: '')

    ID

  • parent_id (String) (defaults to: '')

    親ID

  • reference (Reference) (defaults to: Reference.new)

    参照

  • western_date (Western::Calendar) (defaults to: Western::Calendar.new)

    西暦日

  • annotations (Array<Annotation>) (defaults to: [])

    注釈

  • diffs (Diffs) (defaults to: Diffs.new)

    総差分



50
51
52
53
54
55
56
57
58
# File 'lib/zakuro/operation/month/type.rb', line 50

def initialize(id: '', parent_id: '', reference: Reference.new,
               western_date: Western::Calendar.new, annotations: [], diffs: Diffs.new)
  @id = id
  @parent_id = parent_id
  @reference = reference
  @western_date = western_date
  @annotations = annotations
  @diffs = diffs
end

Instance Attribute Details

#annotationsArray<Annotation> (readonly)

Returns 注釈.

Returns:



33
34
35
# File 'lib/zakuro/operation/month/type.rb', line 33

def annotations
  @annotations
end

#diffsDiffs (readonly)

Returns 総差分.

Returns:



35
36
37
# File 'lib/zakuro/operation/month/type.rb', line 35

def diffs
  @diffs
end

#idString (readonly)

Returns ID.

Returns:

  • (String)

    ID



25
26
27
# File 'lib/zakuro/operation/month/type.rb', line 25

def id
  @id
end

#parent_idString (readonly)

Returns 親ID.

Returns:

  • (String)

    親ID



27
28
29
# File 'lib/zakuro/operation/month/type.rb', line 27

def parent_id
  @parent_id
end

#referenceReference (readonly)

Returns 参照.

Returns:



29
30
31
# File 'lib/zakuro/operation/month/type.rb', line 29

def reference
  @reference
end

#western_dateWestern::Calendar (readonly)

Returns 西暦日.

Returns:



31
32
33
# File 'lib/zakuro/operation/month/type.rb', line 31

def western_date
  @western_date
end

Instance Method Details

#invalid?True, False

無効か

Returns:

  • (True)

    無効

  • (False)

    有効



67
68
69
# File 'lib/zakuro/operation/month/type.rb', line 67

def invalid?
  id == ''
end