Module: Simplifyapi::CollectionRepresenter

Extended by:
ActiveSupport::Concern
Defined in:
lib/simplifyapi/collection_representer.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#initialize(collection) ⇒ Object



8
9
10
# File 'lib/simplifyapi/collection_representer.rb', line 8

def initialize collection
  @collection = collection
end

#to_jsonObject



12
13
14
# File 'lib/simplifyapi/collection_representer.rb', line 12

def to_json
  self.class.export(@collection).to_json
end