Class: Dspace::Policy

Inherits:
Object
  • Object
show all
Defined in:
lib/dspace/policy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Policy

Returns a new instance of Policy.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/dspace/policy.rb', line 8

def initialize args
  @id = args['id']
  @action = args['action']
  @eperson_id = args['epersonId']
  @group_id = args['groupId']
  @resource_id = args['resourceId']
  @resource_type = args['resourceType']
  @rp_description = args['rpDescription']
  @rp_name = args['rpName']
  @rp_type = args['rpType']
  @start_date = args['startDate']
  @end_date = args['endDate']
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def action
  @action
end

#end_dateObject (readonly)

Returns the value of attribute end_date.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def end_date
  @end_date
end

#eperson_idObject (readonly)

Returns the value of attribute eperson_id.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def eperson_id
  @eperson_id
end

#group_idObject (readonly)

Returns the value of attribute group_id.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def group_id
  @group_id
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def id
  @id
end

#resource_idObject (readonly)

Returns the value of attribute resource_id.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def resource_id
  @resource_id
end

#resource_typeObject (readonly)

Returns the value of attribute resource_type.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def resource_type
  @resource_type
end

#rp_descriptionObject (readonly)

Returns the value of attribute rp_description.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def rp_description
  @rp_description
end

#rp_nameObject (readonly)

Returns the value of attribute rp_name.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def rp_name
  @rp_name
end

#rp_typeObject (readonly)

Returns the value of attribute rp_type.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def rp_type
  @rp_type
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



4
5
6
# File 'lib/dspace/policy.rb', line 4

def start_date
  @start_date
end

Instance Method Details

#to_hObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/dspace/policy.rb', line 22

def to_h
  {
      id: @id,
      action: @action,
      epersonId: @eperson_id,
      groupId: @group_id,
      resourceId: @resource_id,
      resourceType: @resource_type,
      rpDescription: @rp_description,
      rpName: @rp_name,
      rpType: @rp_type,
      startDate: @start_date,
      endDate: @end_date
  }
end