Class: Moon::Action::Model::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/action/model/index.rb

Overview

Common model index action

Instance Method Summary collapse

Constructor Details

#initialize(collection_key) ⇒ Index

Returns a new instance of Index.



5
6
7
# File 'lib/moon/action/model/index.rb', line 5

def initialize(collection_key)
  @collection_key = collection_key
end

Instance Method Details

#perform(context) ⇒ Object



9
10
11
12
# File 'lib/moon/action/model/index.rb', line 9

def perform(context)
  @context = context
  Moon::Response::JSON::Collection.new collection, formatters
end