Class: Super_Student

Inherits:
Object
  • Object
show all
Defined in:
lib/files/Super_Student.rb

Direct Known Subclasses

Student, Student_short

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, surname, father_name, id, git) ⇒ Super_Student

Returns a new instance of Super_Student.



5
6
7
8
9
10
11
# File 'lib/files/Super_Student.rb', line 5

def initialize(name, surname, father_name, id, git)
  self.Name = name
  self.Surname = surname
  self.Father_name = father_name
  self.ID = id
  self.Git = git
end

Instance Attribute Details

#Father_nameObject

Returns the value of attribute Father_name.



3
4
5
# File 'lib/files/Super_Student.rb', line 3

def Father_name
  @Father_name
end

#GitObject

Returns the value of attribute Git.



3
4
5
# File 'lib/files/Super_Student.rb', line 3

def Git
  @Git
end

#IDObject

Returns the value of attribute ID.



3
4
5
# File 'lib/files/Super_Student.rb', line 3

def ID
  @ID
end

#NameObject

Returns the value of attribute Name.



3
4
5
# File 'lib/files/Super_Student.rb', line 3

def Name
  @Name
end

#SurnameObject

Returns the value of attribute Surname.



3
4
5
# File 'lib/files/Super_Student.rb', line 3

def Surname
  @Surname
end

Class Method Details

.acc_valid?(account) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/files/Super_Student.rb', line 40

def self.acc_valid?()
  .match(/^@[\w\d\-_]+$/)
end

.id_valid?(id) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/files/Super_Student.rb', line 13

def self.id_valid?(id)
  String(id).match(/^\d+$/)
end

.name_valid?(name) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/files/Super_Student.rb', line 21

def self.name_valid?(name)
  name.match(/^[А-Я][^А-Я\d]+$/)
end

.parse_str(str) ⇒ Object



53
54
# File 'lib/files/Super_Student.rb', line 53

def self.parse_str(str)
end

Instance Method Details

#contactObject



59
60
# File 'lib/files/Super_Student.rb', line 59

def contact
end

#getInfoObject



56
57
# File 'lib/files/Super_Student.rb', line 56

def getInfo
end

#short_nameObject



49
50
51
# File 'lib/files/Super_Student.rb', line 49

def short_name
  "#{Surname} #{Name.upcase[0]}. #{Father_name.upcase[0]}"
end

#to_sObject



62
63
# File 'lib/files/Super_Student.rb', line 62

def to_s
end