Class: Craftar::Image

Inherits:
Base
  • Object
show all
Defined in:
lib/craftar/image.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

basic_options, create, #destroy, find, list, parse_response

Constructor Details

#initialize(opts) ⇒ Image

Returns a new instance of Image.



9
10
11
# File 'lib/craftar/image.rb', line 9

def initialize(opts)
  set_attributes(opts)
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



3
4
5
# File 'lib/craftar/image.rb', line 3

def file
  @file
end

#itemObject (readonly)

Returns the value of attribute item.



3
4
5
# File 'lib/craftar/image.rb', line 3

def item
  @item
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/craftar/image.rb', line 3

def name
  @name
end

#resource_uriObject (readonly)

Returns the value of attribute resource_uri.



3
4
5
# File 'lib/craftar/image.rb', line 3

def resource_uri
  @resource_uri
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/craftar/image.rb', line 3

def status
  @status
end

#thumb_120Object (readonly)

Returns the value of attribute thumb_120.



3
4
5
# File 'lib/craftar/image.rb', line 3

def thumb_120
  @thumb_120
end

#thumb_60Object (readonly)

Returns the value of attribute thumb_60.



3
4
5
# File 'lib/craftar/image.rb', line 3

def thumb_60
  @thumb_60
end

#tracking_data_statusObject (readonly)

Returns the value of attribute tracking_data_status.



3
4
5
# File 'lib/craftar/image.rb', line 3

def tracking_data_status
  @tracking_data_status
end

#uuidObject (readonly)

Returns the value of attribute uuid.



3
4
5
# File 'lib/craftar/image.rb', line 3

def uuid
  @uuid
end

Class Method Details

.craftar_nameObject



5
6
7
# File 'lib/craftar/image.rb', line 5

def self.craftar_name
  'image'
end

Instance Method Details

#saveObject



13
14
15
16
17
# File 'lib/craftar/image.rb', line 13

def save
  response = call(:post, file: prepare_file_from_url(@file), item: item)
  set_attributes(response)
  self
end