Class: Ey::Core::Client::Log
- Extended by:
- Associations
- Defined in:
- lib/ey-core/models/log.rb
Instance Attribute Summary collapse
-
#component_action_id ⇒ Object
Returns the value of attribute component_action_id.
-
#file ⇒ Object
Returns the value of attribute file.
Instance Method Summary collapse
Methods included from Associations
assoc_accessor, assoc_coverage, assoc_reader, assoc_writer, associations, collection_reader
Methods inherited from Model
#destroy, range_parser, #save, #update!, #url
Instance Attribute Details
#component_action_id ⇒ Object
Returns the value of attribute component_action_id.
13 14 15 |
# File 'lib/ey-core/models/log.rb', line 13 def component_action_id @component_action_id end |
#file ⇒ Object
Returns the value of attribute file.
13 14 15 |
# File 'lib/ey-core/models/log.rb', line 13 def file @file end |
Instance Method Details
#save! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ey-core/models/log.rb', line 15 def save! if self.file.kind_of?(File) body = File.read(self.file) else body = self.file end params = { "component_action_id" => component_action_id, "log" => { "file" => body, "filename" => filename || "log", "mime_type" => mime_type, } } merge_attributes(self.connection.create_log(params).body["log"]) end |