class MessengerPigeon::Redmine::Source

Source definition

Public Instance Methods

complete() click to toggle source
# File lib/messenger_pigeon/modules/redmine.rb, line 60
def complete
end
read() click to toggle source
# File lib/messenger_pigeon/modules/redmine.rb, line 52
def read
  if @options[:mode] == :specific
    [@resource.find(@options[:key]).attributes]
  elsif @options[:mode] == :all
    read_all
  end
end

Private Instance Methods

read_all() click to toggle source
# File lib/messenger_pigeon/modules/redmine.rb, line 65
def read_all
  res = @resource.find(:all, params: @options[:params])
  res.map do |r|
    attrs = r.attributes
    attrs.each do |k, v|
      # Convert 1 level of nested attributes
      attrs[k] = v.attributes if v.respond_to? :attributes
    end
  end
end