diff --git a/README.md b/README.md index ccbebec..667914a 100644 --- a/README.md +++ b/README.md @@ -531,6 +531,15 @@ and [more aliases!](config/movies.yml) => ["キュアミラクル", "キュアマジカル", "キュアフェリーチェ", "キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール"] ``` +### `Precure.miracle_universe` +```ruby +>> Precure.miracle_universe.count +=> 15 + +>> Precure.miracle_universe.map(&:precure_name) +=> ["キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール", "キュアマシェリ", "キュアアムール", "キュアスター", "キュアミルキー", "キュアソレイユ", "キュアセレーネ"] +``` + ### Equivalence ```ruby >> yayoi = Cure.peace.dup diff --git a/config/movies.yml b/config/movies.yml index 9fe2294..ec664d3 100644 --- a/config/movies.yml +++ b/config/movies.yml @@ -68,3 +68,7 @@ ss: memories: &memories title: 映画HUGっと!プリキュア♡ふたりはプリキュア オールスターズメモリーズ started_date: 2018-10-27 +####################################################### +miracle_universe: &miracle_universe + title: 映画プリキュアミラクルユニバース + started_date: 2019-03-16 diff --git a/lib/rubicure/core.rb b/lib/rubicure/core.rb index 779f50d..068dcb6 100644 --- a/lib/rubicure/core.rb +++ b/lib/rubicure/core.rb @@ -195,6 +195,30 @@ def super_stars end alias_method :superstars, :super_stars + # rubocop:disable Metrics/LineLength + + # Get precure miracle universe + # + # @return [Array] precure miracle universe + # + # @example + # Precure.miracle_universe.count + # #=> 15 + # + # Precure.miracle_universe.map(&:precure_name) + # #=> ["キュアホイップ", "キュアカスタード", "キュアジェラート", "キュアマカロン", "キュアショコラ", "キュアパルフェ", "キュアエール", "キュアアンジュ", "キュアエトワール", "キュアマシェリ", "キュアアムール", "キュアスター", "キュアミルキー", "キュアソレイユ", "キュアセレーネ"] + def miracle_universe + return @miracle_universe if @miracle_universe + + girls = Precure.a_la_mode.girls + Precure.hugtto.girls + Precure.star_twinkle.girls + + miracle_universe_date = Rubicure::Movie.find(:miracle_universe).started_date + @miracle_universe = girls.select {|girl| girl.created_date && girl.created_date <= miracle_universe_date } + + @miracle_universe + end + # rubocop:enable Metrics/LineLength + # iterate with :unmarked, :max_heart, ... # # @yield series diff --git a/spec/rubicure/core_spec.rb b/spec/rubicure/core_spec.rb index fc240b5..ecc2802 100644 --- a/spec/rubicure/core_spec.rb +++ b/spec/rubicure/core_spec.rb @@ -156,4 +156,30 @@ it { should contain_exactly(*super_stars_girl_names) } end + + describe "#miracle_universe" do + subject { Precure.miracle_universe.map(&:girl_name) } + + let(:miracle_universe_girl_names) do + [ + Cure.whip, + Cure.custard, + Cure.gelato, + Cure.macaron, + Cure.chocolat, + Cure.parfait, + Cure.yell, + Cure.ange, + Cure.etoile, + Cure.macherie, + Cure.amour, + Cure.star, + Cure.milky, + Cure.soleil, + Cure.selene, + ].map(&:girl_name) + end + + it { should contain_exactly(*miracle_universe_girl_names) } + end end diff --git a/spec/rubicure/movie_spec.rb b/spec/rubicure/movie_spec.rb index 3d1d77c..3beae36 100644 --- a/spec/rubicure/movie_spec.rb +++ b/spec/rubicure/movie_spec.rb @@ -12,6 +12,7 @@ :dream_stars, :super_stars, :memories, + :miracle_universe, ] end