Class: VivlioStarter::CLI::ConfigKeys::Spec

Inherits:
Data
  • Object
show all
Defined in:
lib/vivlio_starter/cli/config_keys.rb

Overview

キー 1 件の宣言。ハッシュリテラルではなく Data を使うのは、打ち間違いを 即座に落とすため(Spec[defualt: 500] は ArgumentError だが { defualt: 500 } は静かに通り、既定値を持たないキーとして振る舞う)。

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default: nil, retired: nil, authored: nil) ⇒ Spec

Returns a new instance of Spec.



35
# File 'lib/vivlio_starter/cli/config_keys.rb', line 35

def initialize(default: nil, retired: nil, authored: nil) = super

Instance Attribute Details

#authoredObject (readonly)

Returns the value of attribute authored

Returns:

  • (Object)

    the current value of authored



34
35
36
# File 'lib/vivlio_starter/cli/config_keys.rb', line 34

def authored
  @authored
end

#defaultObject (readonly)

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



34
35
36
# File 'lib/vivlio_starter/cli/config_keys.rb', line 34

def default
  @default
end

#retiredObject (readonly)

Returns the value of attribute retired

Returns:

  • (Object)

    the current value of retired



34
35
36
# File 'lib/vivlio_starter/cli/config_keys.rb', line 34

def retired
  @retired
end

Instance Method Details

#authored?Boolean

著者が埋めるキーか(値は未設定時に見せる記入例)

Returns:

  • (Boolean)


41
# File 'lib/vivlio_starter/cli/config_keys.rb', line 41

def authored? = !authored.nil?

#retired?Boolean

廃止キーか(値は移行先の案内文)

Returns:

  • (Boolean)


38
# File 'lib/vivlio_starter/cli/config_keys.rb', line 38

def retired? = !retired.nil?