Class: StoryExporter
- Inherits:
-
Object
- Object
- StoryExporter
- Defined in:
- lib/artisan/story_exporter.rb
Constant Summary collapse
- UNNECESSARY_FIELDS =
DEPRECATE (BP) - activesupport dependency FTL
[:complete, :completed_at, :creator_id, :deleted, :foreign_id, :iteration_id, :split_from, :updated_at]
Instance Method Summary collapse
-
#initialize(story) ⇒ StoryExporter
constructor
A new instance of StoryExporter.
- #to_json ⇒ Object
Constructor Details
#initialize(story) ⇒ StoryExporter
Returns a new instance of StoryExporter.
7 8 9 |
# File 'lib/artisan/story_exporter.rb', line 7 def initialize(story) @story = story end |
Instance Method Details
#to_json ⇒ Object
11 12 13 14 |
# File 'lib/artisan/story_exporter.rb', line 11 def to_json return "{}" if @story.nil? @story.to_json(:except => UNNECESSARY_FIELDS, :include => {:assigned_user => {:only => :full_name, :methods => [:gravatar_url]}}) end |