Class: StudyTube::StudyTube

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, file = nil) ⇒ StudyTube

Returns a new instance of StudyTube.



15
16
17
18
# File 'lib/StudyTube.rb', line 15

def initialize type, file = nil
  @type = study_type(type)
  $FILE = file
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#create(key, value) ⇒ Object



20
21
22
# File 'lib/StudyTube.rb', line 20

def create key, value
  type.create(key,value)
end

#delete(key) ⇒ Object



28
29
30
# File 'lib/StudyTube.rb', line 28

def delete key
   type.delete(key)
end

#listObject



36
37
38
# File 'lib/StudyTube.rb', line 36

def list
  type.list
end

#show(key) ⇒ Object



32
33
34
# File 'lib/StudyTube.rb', line 32

def show key
   type.show(key)
end

#update(key, value) ⇒ Object



24
25
26
# File 'lib/StudyTube.rb', line 24

def update key, value
  type.update(key,value)
end