Skip to content

Commit 9e20c97

Browse files
committed
Add service factory method to print host
1 parent 60ecbbb commit 9e20c97

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

app/models/print_host.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@ class NotReady < RuntimeError
99
validates :name, presence: true
1010
validates :endpoint, presence: true
1111
validates :protocol, presence: true, inclusion: {in: PROTOCOLS.keys}
12+
13+
def service
14+
PROTOCOLS[protocol].new(print_host: self)
15+
end
1216
end

0 commit comments

Comments
 (0)