mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
22 lines
332 B
Ruby
22 lines
332 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
class << self
|
|
attr_accessor :_attributes
|
|
end
|
|
|
|
def self.inherited(base)
|
|
base._attributes = []
|
|
end
|
|
|
|
def self.attributes(*attrs)
|
|
@_attributes.concat attrs
|
|
end
|
|
|
|
attr_accessor :object
|
|
|
|
def initialize(object)
|
|
@object = object
|
|
end
|
|
end
|
|
end
|