Class: Outreach::Sequence

Inherits:
Object
  • Object
show all
Extended by:
Model
Defined in:
lib/outreach-ruby/sequence.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Sequence

Returns a new instance of Sequence.



9
10
11
12
13
# File 'lib/outreach-ruby/sequence.rb', line 9

def initialize(attrs)
  @id = attrs['id']
  @name = attrs['name']
  @response = attrs['response']
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/outreach-ruby/sequence.rb', line 7

def id
  @id
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/outreach-ruby/sequence.rb', line 7

def name
  @name
end

#responseObject

Returns the value of attribute response.



7
8
9
# File 'lib/outreach-ruby/sequence.rb', line 7

def response
  @response
end

Class Method Details

.build_from_attributes_hash(data) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/outreach-ruby/sequence.rb', line 15

def self.build_from_attributes_hash(data)
  result = {}
  result['id'] = data['id']
  result['name'] = nested_hash_value(
    data,
    %w[attributes name]
  )
  result['response'] = data
  new(result)
end