Class: FakeRails3Routes::Mapper::Resources::SingletonResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/fake_rails3_routes/mapper.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Resource

#controller, #options, #path

Instance Method Summary collapse

Methods inherited from Resource

#actions, #name, #new_scope, #resource_scope

Constructor Details

#initialize(entities, options) ⇒ SingletonResource

Returns a new instance of SingletonResource.



816
817
818
819
820
821
# File 'lib/fake_rails3_routes/mapper.rb', line 816

def initialize(entities, options)
  super
  @as         = nil
  @controller = (options[:controller] || plural).to_s
  @as         = options[:as]
end

Instance Method Details

#default_actionsObject



823
824
825
# File 'lib/fake_rails3_routes/mapper.rb', line 823

def default_actions
  [:show, :create, :update, :destroy, :new, :edit]
end

#pluralObject



827
828
829
# File 'lib/fake_rails3_routes/mapper.rb', line 827

def plural
  @plural ||= name.to_s.pluralize
end

#singularObject Also known as: member_name, collection_name



831
832
833
# File 'lib/fake_rails3_routes/mapper.rb', line 831

def singular
  @singular ||= name.to_s
end