Class: Dsu::Services::EntryGroup::EditorService
- Inherits:
-
Object
- Object
- Dsu::Services::EntryGroup::EditorService
- Defined in:
- lib/dsu/services/entry_group/editor_service.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(entry_group:, options: {}) ⇒ EditorService
constructor
A new instance of EditorService.
Methods included from Dsu::Support::TimeFormatable
dd_mm_yyyy, formatted_time, mm_dd, mm_dd_yyyy, timezone_for, yyyy_mm_dd, yyyy_mm_dd_or_through_for
Methods included from Dsu::Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(entry_group:, options: {}) ⇒ EditorService
Returns a new instance of EditorService.
19 20 21 22 23 24 25 26 |
# File 'lib/dsu/services/entry_group/editor_service.rb', line 19 def initialize(entry_group:, options: {}) raise ArgumentError, 'entry_group is nil' if entry_group.nil? raise ArgumentError, 'entry_group is the wrong object type' unless entry_group.is_a?(Models::EntryGroup) raise ArgumentError, 'options is the wrong object type' unless .is_a?(Hash) || .nil? @entry_group = entry_group = || {} end |
Instance Method Details
#call ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/dsu/services/entry_group/editor_service.rb', line 28 def call edit_view = render_edit_view edit edit_view # NOTE: Return the original entry group object as any permanent changes # will have been applied to it. entry_group end |