Class: Everlog::Dom::Module::Moves
- Inherits:
-
Everlog::Dom::Module
- Object
- Everlog::Dom::Module
- Everlog::Dom::Module::Moves
- Defined in:
- lib/everlog/dom/module/moves.rb
Class Method Summary collapse
-
.fetch_since(date) ⇒ Object
date対応してない.
Instance Method Summary collapse
- #api_client ⇒ Object
-
#initialize(config) ⇒ Moves
constructor
A new instance of Moves.
- #storyline ⇒ Object
- #summary ⇒ Object
Constructor Details
#initialize(config) ⇒ Moves
Returns a new instance of Moves.
3 4 5 |
# File 'lib/everlog/dom/module/moves.rb', line 3 def initialize config @config = config end |
Class Method Details
.fetch_since(date) ⇒ Object
date対応してない
28 29 30 31 |
# File 'lib/everlog/dom/module/moves.rb', line 28 def fetch_since date instance = self.new(Dom::Entity::Config.moves) { summary: instance.summary, storyline: instance.storyline } end |
Instance Method Details
#api_client ⇒ Object
7 8 9 |
# File 'lib/everlog/dom/module/moves.rb', line 7 def api_client @api_client ||= Inf::Api::Moves.new(@config) end |
#storyline ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/everlog/dom/module/moves.rb', line 11 def storyline api_client.daily_storyline.map do |story| case story['type'] when 'place' Dom::Value::Moves::Referer::Place.new story when 'move' Dom::Value::Moves::Referer::Move.new story end end end |
#summary ⇒ Object
22 23 24 |
# File 'lib/everlog/dom/module/moves.rb', line 22 def summary Dom::Value::Moves::Summary.new(api_client.daily_summary) end |