Class: AbstractStudent

Inherits:
Object
  • Object
show all
Defined in:
lib/source/models/student/student_abstract.rb

Direct Known Subclasses

Student, StudentShort

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contactObject (readonly)

Returns the value of attribute contact.



6
7
8
# File 'lib/source/models/student/student_abstract.rb', line 6

def contact
  @contact
end

#gitObject (readonly)

Returns the value of attribute git.



6
7
8
# File 'lib/source/models/student/student_abstract.rb', line 6

def git
  @git
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/source/models/student/student_abstract.rb', line 6

def id
  @id
end

Instance Method Details

#get_infoObject



10
11
12
# File 'lib/source/models/student/student_abstract.rb', line 10

def get_info
  "#{get_fio};#{get_contact};#{get_git}"
end

#to_sObject



14
15
16
17
18
19
20
# File 'lib/source/models/student/student_abstract.rb', line 14

def to_s
  vars = {}
  instance_variables.map do |attribute|
    vars[attribute.to_s[1..]] = instance_variable_get(attribute)
  end
  JSON(vars)
end