Class: ApprovalHub::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/approval_hub/request.rb

Overview

A Request is passed to the hub for registration

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#approver_idObject

Returns the value of attribute approver_id.



6
7
8
# File 'lib/approval_hub/request.rb', line 6

def approver_id
  @approver_id
end

#long_descriptionObject

Returns the value of attribute long_description.



5
6
7
# File 'lib/approval_hub/request.rb', line 5

def long_description
  @long_description
end

#request_idObject

Returns the value of attribute request_id.



5
6
7
# File 'lib/approval_hub/request.rb', line 5

def request_id
  @request_id
end

#requestor_idObject

Returns the value of attribute requestor_id.



6
7
8
# File 'lib/approval_hub/request.rb', line 6

def requestor_id
  @requestor_id
end

#short_descriptionObject

Returns the value of attribute short_description.



5
6
7
# File 'lib/approval_hub/request.rb', line 5

def short_description
  @short_description
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/approval_hub/request.rb', line 6

def url
  @url
end

Instance Method Details

#is_valid?Boolean

Will return false if fields have not been set TODO - return an errors hash stating why the request is not valid

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
# File 'lib/approval_hub/request.rb', line 10

def is_valid?
  not request_id.nil?         ||
      long_description.nil?   ||
      short_description.nil?  ||
      requestor_id.nil?       ||
      approver_id.nil?        ||
      url.nil?
end