Class: Troo::External::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/troo/external/comment.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(external_id, options = {}) ⇒ Comment

Returns a new instance of Comment.



12
13
14
15
# File 'lib/troo/external/comment.rb', line 12

def initialize(external_id, options = {})
  @external_id = external_id
  @options     = options
end

Class Method Details

.fetch(external_id, options = {}) ⇒ Object



5
6
7
8
9
# File 'lib/troo/external/comment.rb', line 5

def fetch(external_id, options = {})
  new(external_id, options).fetch_by_external_id.map do |resource|
    Troo::CommentPersistence.for(resource)
  end
end

Instance Method Details

#fetch_by_external_idObject



17
18
19
20
21
22
23
# File 'lib/troo/external/comment.rb', line 17

def fetch_by_external_id
  case options.fetch(:mode)
  when :board then board_mode
  when :list  then list_mode
  when :card  then card_mode
  end
end