Class: Classroom
- Inherits:
-
Object
- Object
- Classroom
- Includes:
- FirebaseCreateCommand, FirebaseUpdateCommand
- Defined in:
- lib/codefusion/classroom.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#parent_dir ⇒ Object
readonly
Returns the value of attribute parent_dir.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path, file) ⇒ Classroom
constructor
A new instance of Classroom.
- #update ⇒ Object
- #url ⇒ Object
Methods included from FirebaseCreateCommand
Methods included from FirebaseCommand
#classroom_codes, #get_config, #request_url, #uri
Constructor Details
#initialize(path, file) ⇒ Classroom
Returns a new instance of Classroom.
9 10 11 12 13 14 15 16 |
# File 'lib/codefusion/classroom.rb', line 9 def initialize(path, file) @path = path @dir = path.split('/').last @parent_dir = File.dirname(path) @code = new_code @file = file update end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/codefusion/classroom.rb', line 5 def file @file end |
#parent_dir ⇒ Object (readonly)
Returns the value of attribute parent_dir.
5 6 7 |
# File 'lib/codefusion/classroom.rb', line 5 def parent_dir @parent_dir end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/codefusion/classroom.rb', line 5 def path @path end |
Instance Method Details
#update ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/codefusion/classroom.rb', line 18 def update request = [@code, make_hash] if @uuid FirebaseUpdateCommand.update(request, @uuid) else @uuid = set_uuid(FirebaseCreateCommand.create(request)) end end |
#url ⇒ Object
27 28 29 |
# File 'lib/codefusion/classroom.rb', line 27 def url generate_url end |