Class: OsuCcScraper::Department
- Inherits:
-
Struct
- Object
- Struct
- OsuCcScraper::Department
- Defined in:
- lib/osu-cc-scraper/department.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#subject_code ⇒ Object
Returns the value of attribute subject_code.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/osu-cc-scraper/department.rb', line 7 def name @name end |
#subject_code ⇒ Object
Returns the value of attribute subject_code
7 8 9 |
# File 'lib/osu-cc-scraper/department.rb', line 7 def subject_code @subject_code end |
Class Method Details
.from_json(json) ⇒ Object
18 19 20 |
# File 'lib/osu-cc-scraper/department.rb', line 18 def self.from_json(json) Department.new(*JSON.parse(json).values) end |
Instance Method Details
#courses ⇒ Object
9 10 11 12 |
# File 'lib/osu-cc-scraper/department.rb', line 9 def courses html = fetch_courses parse_courses(html) end |
#to_json ⇒ Object
14 15 16 |
# File 'lib/osu-cc-scraper/department.rb', line 14 def to_json self.to_h.to_json end |