Class: SyoboiCalendar::Parsers::Base
- Inherits:
-
Object
- Object
- SyoboiCalendar::Parsers::Base
- Defined in:
- lib/syoboi_calendar/parsers/base.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(response) ⇒ Base
constructor
A new instance of Base.
- #parse ⇒ Object
Constructor Details
#initialize(response) ⇒ Base
Returns a new instance of Base.
12 13 14 |
# File 'lib/syoboi_calendar/parsers/base.rb', line 12 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
10 11 12 |
# File 'lib/syoboi_calendar/parsers/base.rb', line 10 def response @response end |
Class Method Details
.parse(response) ⇒ Object
5 6 7 |
# File 'lib/syoboi_calendar/parsers/base.rb', line 5 def parse(response) new(response).parse end |
Instance Method Details
#parse ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/syoboi_calendar/parsers/base.rb', line 16 def parse items.map do |item| resource_class.new(item) end rescue NoMethodError [] end |