Class: Files::EmailFeedback

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/email_feedback.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ EmailFeedback

Returns a new instance of EmailFeedback.



7
8
9
10
# File 'lib/files.com/models/email_feedback.rb', line 7

def initialize(attributes = {}, options = {})
  @attributes = attributes || {}
  @options = options || {}
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/email_feedback.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/email_feedback.rb', line 5

def options
  @options
end

Class Method Details

.create(params = {}, options = {}) ⇒ Object

Parameters:

feedback[email] (required) - string
feedback[reason] (required) - string


24
25
26
27
# File 'lib/files.com/models/email_feedback.rb', line 24

def self.create(params = {}, options = {})
  response, _options = Api.send_request("/email_feedback", :post, params, options)
  response.data
end

Instance Method Details

#saveObject



12
13
14
15
16
17
18
19
# File 'lib/files.com/models/email_feedback.rb', line 12

def save
  if @attributes[:id]
    raise NotImplementedError.new("The EmailFeedback object doesn't support updates.")
  else
    new_obj = EmailFeedback.create(@attributes, @options)
    @attributes = new_obj.attributes
  end
end