Class: FlixCloud::File

Inherits:
Record
  • Object
show all
Defined in:
lib/flix_cloud/file.rb

Direct Known Subclasses

Parameters

Instance Attribute Summary collapse

Attributes inherited from Record

#errors

Instance Method Summary collapse

Methods inherited from Record

#attributes=, #initialize, record_column

Constructor Details

This class inherits a constructor from FlixCloud::Record

Instance Attribute Details

#costObject

Returns the value of attribute cost.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def cost
  @cost
end

#durationObject

Returns the value of attribute duration.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def duration
  @duration
end

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def height
  @height
end

#sizeObject

Returns the value of attribute size.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def size
  @size
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def url
  @url
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/flix_cloud/file.rb', line 3

def width
  @width
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/flix_cloud/file.rb', line 7

def valid?
  self.errors = []

  unless url
    self.errors << "url is required"
  end

  if parameters && !parameters.valid?
    self.errors << {:parameters => parameters.errors}
  end

  errors.empty?
end