Sha256: e5f38d5f0b10a89ae29eb571acbf4269c4746b2f64381dfe1f872065c45a42f2

Contents?: true

Size: 514 Bytes

Versions: 4

Compression:

Stored size: 514 Bytes

Contents

module Makitoo
  module FeatureFlag

    class User

      attr_accessor :id

      def initialize(id, attributes = {})
        @id = id
        @attributes = attributes
      end

      def as_json(options = {})
        result = @attributes.clone
        result[:id] = @id
        result
      end

      def self.of(string_or_user)
        if string_or_user.is_a? String
          User.new(string_or_user)
        else
          string_or_user
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
makitoo-feature_flag-0.1.8 lib/makitoo/feature_flag/user.rb
makitoo-feature_flag-0.1.7 lib/makitoo/feature_flag/user.rb
makitoo-feature_flag-0.1.6 lib/makitoo/feature_flag/user.rb
makitoo-feature_flag-0.1.5 lib/makitoo/feature_flag/user.rb