Class: FlixCloud::Parameters

Inherits:
File show all
Defined in:
lib/flix_cloud/parameters.rb

Instance Attribute Summary collapse

Attributes inherited from File

#cost, #duration, #height, #size, #url, #width

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

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/flix_cloud/parameters.rb', line 5

def valid?
  self.errors = []

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

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

  errors.empty?
end