Class: Vivlio::Starter::CLI::TokenResolver::Entry
- Inherits:
-
Data
- Object
- Data
- Vivlio::Starter::CLI::TokenResolver::Entry
- Defined in:
- lib/vivlio/starter/cli/token_resolver.rb
Overview
章情報を保持する不変データ構造。Resolver が返す全ての章情報はこの型で統一される。
Instance Attribute Summary collapse
-
#exists ⇒ Object
readonly
Returns the value of attribute exists.
-
#in_catalog ⇒ Object
readonly
Returns the value of attribute in_catalog.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#slug ⇒ Object
readonly
Returns the value of attribute slug.
-
#valid ⇒ Object
readonly
Returns the value of attribute valid.
Instance Method Summary collapse
-
#basename ⇒ Object
ファイル名のベース部分を動的に生成する。 number と slug から導出されるため、属性間の不整合が発生しない。 システムファイル(number=nil)の場合は slug のみを返す。.
-
#exists? ⇒ Boolean
exists フラグの述語メソッド。.
-
#in_catalog? ⇒ Boolean
in_catalog フラグの述語メソッド。.
-
#valid? ⇒ Boolean
valid フラグの述語メソッド。.
Instance Attribute Details
#exists ⇒ Object (readonly)
Returns the value of attribute exists
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def exists @exists end |
#in_catalog ⇒ Object (readonly)
Returns the value of attribute in_catalog
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def in_catalog @in_catalog end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def kind @kind end |
#label ⇒ Object (readonly)
Returns the value of attribute label
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def label @label end |
#number ⇒ Object (readonly)
Returns the value of attribute number
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def number @number end |
#path ⇒ Object (readonly)
Returns the value of attribute path
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def path @path end |
#slug ⇒ Object (readonly)
Returns the value of attribute slug
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def slug @slug end |
#valid ⇒ Object (readonly)
Returns the value of attribute valid
16 17 18 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 16 def valid @valid end |
Instance Method Details
#basename ⇒ Object
ファイル名のベース部分を動的に生成する。number と slug から導出されるため、属性間の不整合が発生しない。システムファイル(number=nil)の場合は slug のみを返す。
20 21 22 23 24 25 26 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 20 def basename if number slug ? "#{number}-#{slug}" : number else slug end end |
#exists? ⇒ Boolean
exists フラグの述語メソッド。
35 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 35 def exists? = exists |
#in_catalog? ⇒ Boolean
in_catalog フラグの述語メソッド。
32 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 32 def in_catalog? = in_catalog |
#valid? ⇒ Boolean
valid フラグの述語メソッド。
29 |
# File 'lib/vivlio/starter/cli/token_resolver.rb', line 29 def valid? = valid |