Sha256: 0296b23cc9678938f9ddf7f1f56c29cce97365958245109807395d777d12e251

Contents?: true

Size: 345 Bytes

Versions: 8

Compression:

Stored size: 345 Bytes

Contents

# frozen_string_literal: true

module Cacchern
  class SortableMember
    include ActiveModel::Model

    attr_reader :key, :value

    define_model_callbacks :initialize
    before_initialize { throw(:abort) unless valid? }

    def initialize(key, value)
      @key = key
      @value = value
      run_callbacks :initialize
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cacchern-0.0.11 lib/cacchern/sortable_member.rb
cacchern-0.0.10 lib/cacchern/sortable_member.rb
cacchern-0.0.9 lib/cacchern/sortable_member.rb
cacchern-0.0.8 lib/cacchern/sortable_member.rb
cacchern-0.0.7 lib/cacchern/sortable_member.rb
cacchern-0.0.6 lib/cacchern/sortable_member.rb
cacchern-0.0.5 lib/cacchern/sortable_member.rb
cacchern-0.0.4 lib/cacchern/sortable_member.rb