runcible / lib / runcible / models / distributor.rb @ c0df0f4c
1 |
require 'active_support/json'
|
---|---|
2 |
require 'securerandom'
|
3 |
|
4 |
module Runcible |
5 |
module Models |
6 |
class Distributor |
7 |
attr_accessor 'auto_publish', 'id' |
8 |
|
9 |
def initialize(params = {}) |
10 |
@auto_publish = false |
11 |
self.id = params[:id] || SecureRandom.hex(10) |
12 |
params.each { |k, v| send("#{k}=", v) }
|
13 |
end
|
14 |
|
15 |
# Distributor Type id
|
16 |
#
|
17 |
# @return [string]
|
18 |
def type_id |
19 |
self.class.type_id
|
20 |
end
|
21 |
|
22 |
def self.type_id |
23 |
fail NotImplementedError('self.type_id')
|
24 |
end
|
25 |
end
|
26 |
end
|
27 |
end
|