lib/governor/controllers/helpers.rb in governor-0.2.0 vs lib/governor/controllers/helpers.rb in governor-0.2.1

- old
+ new

@@ -1,19 +1,28 @@ module Governor - module Controllers + module Controllers #:nodoc: module Helpers + # Represents the article for this session. Can also be accessed as an + # instance variable, for example <code>@article</code> if the Mapping + # class is Article. def resource instance_variable_get("@#{mapping.singular}") end + # Returns a symbol representation of this resource, for example + # <code>:article</code> if the Mapping class is Article. def resource_sym mapping.singular end - + + # Returns the list of articles for this session. Can also be accessed as + # an instance variable, for example <code>@articles</code> if the + # Mapping class is Article. def resources instance_variable_get("@#{mapping.plural}") end - + + # Returns the Mapping model class, for example: Article. def model_class @model_class ||= mapping.to end private \ No newline at end of file