Class: TokyoMetro::Static::OperationDay::Info
- Inherits:
-
Object
- Object
- TokyoMetro::Static::OperationDay::Info
- Includes:
- ClassNameLibrary::Static::OperationDay, Modules::Common::ToFactory::Generate::Info, Modules::Common::ToFactory::Seed::Info
- Defined in:
- lib/tokyo_metro/static/operation_day/info.rb
Instance Attribute Summary collapse
-
#name_en ⇒ Object
(also: #en)
readonly
Returns the value of attribute name_en.
-
#name_ja ⇒ Object
(also: #ja)
readonly
Returns the value of attribute name_ja.
-
#same_as ⇒ Object
readonly
Returns the value of attribute same_as.
Instance Method Summary collapse
-
#initialize(name_ja, name_en, same_as) ⇒ Info
constructor
A new instance of Info.
- #match?(operation_day) ⇒ Boolean
- #to_a ⇒ Object
- #to_h ⇒ Object
Methods included from Modules::Common::ToFactory::Seed::Info
Constructor Details
#initialize(name_ja, name_en, same_as) ⇒ Info
Returns a new instance of Info.
7 8 9 10 11 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 7 def initialize( name_ja , name_en , same_as ) @name_ja = name_ja @name_en = name_en @same_as = same_as end |
Instance Attribute Details
#name_en ⇒ Object (readonly) Also known as: en
Returns the value of attribute name_en.
14 15 16 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 14 def name_en @name_en end |
#name_ja ⇒ Object (readonly) Also known as: ja
Returns the value of attribute name_ja.
13 14 15 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 13 def name_ja @name_ja end |
#same_as ⇒ Object (readonly)
Returns the value of attribute same_as.
15 16 17 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 15 def same_as @same_as end |
Instance Method Details
#match?(operation_day) ⇒ Boolean
28 29 30 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 28 def match?( operation_day ) self.to_a.include?( operation_day ) or @name_en.gsub( /\,? / , "_" ).downcase.to_s == operation_day.to_s end |
#to_a ⇒ Object
20 21 22 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 20 def to_a [ @name_ja , @name_en , @same_as ] end |
#to_h ⇒ Object
24 25 26 |
# File 'lib/tokyo_metro/static/operation_day/info.rb', line 24 def to_h { name_ja: @name_ja , name_en: @name_en , same_as: @same_as } end |