Class: Driftrock::Service::DriftrockModel::ChannelType

Inherits:
Object
  • Object
show all
Includes:
Driftrock::Service::DriftrockModel
Defined in:
lib/driftrock-service/driftrock_model/channel_type.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Driftrock::Service::DriftrockModel

#get_from_api_method, included, #initialize, #post_to_api_method, #put_to_api_method

Instance Attribute Details

#channel_statusObject (readonly)

Returns the value of attribute channel_status.



5
6
7
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 5

def channel_status
  @channel_status
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 5

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 5

def name
  @name
end

#next_step_actionObject (readonly)

Returns the value of attribute next_step_action.



5
6
7
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 5

def next_step_action
  @next_step_action
end

Class Method Details

.find_by_name(name) ⇒ Object



16
17
18
19
20
21
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 16

def self.find_by_name(name)
  object_hash = get_from_api_method.call(
    "/#{name}/by_name"
  )
  new(object_hash)
end

Instance Method Details

#create_channel(channel_data) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/driftrock-service/driftrock_model/channel_type.rb', line 7

def create_channel(channel_data)
  response = post_to_api_method.call(
    "/#{name}", channel_data
  )
  channel = Channel.new(channel_data)
  channel.channel_type = self
  channel
end