unepwcmc/SAPI

View on GitHub
app/services/checklist/timeline_year.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Checklist::TimelineYear
  include ActiveModel::SerializerSupport
  attr_accessor :id, :year, :pos
  # options to be passed:
  #:year - year on the timeline
  #:pos - position (%)
  def initialize(options)
    @id = (options[:taxon_concept_id] << 8) + options[:year]
    @year = options[:year]
    @pos = options[:pos]
  end
end