Class: Transilien::Time
- Inherits:
-
FakeMicroService
- Object
- MicroService
- FakeMicroService
- Transilien::Time
- Defined in:
- lib/transilien/time.rb
Constant Summary
Constants inherited from MicroService
MicroService::API_HOST, MicroService::API_URI, MicroService::Default_cache_duration
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#total_seconds ⇒ Object
Returns the value of attribute total_seconds.
Attributes inherited from MicroService
#access_time, #external_code, #payload
Class Method Summary collapse
Instance Method Summary collapse
-
#name ⇒ Object
objective: enable caching.
Methods inherited from FakeMicroService
Methods inherited from MicroService
action, action_component, action_instance_xpath, action_param, add_filters, cache_it, cache_keys, errors, filters, filters=, find, find_from_full_query_cache, find_from_query_caches, http, params, #to_s
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
2 3 4 |
# File 'lib/transilien/time.rb', line 2 def day @day end |
#hour ⇒ Object
Returns the value of attribute hour.
2 3 4 |
# File 'lib/transilien/time.rb', line 2 def hour @hour end |
#minute ⇒ Object
Returns the value of attribute minute.
2 3 4 |
# File 'lib/transilien/time.rb', line 2 def minute @minute end |
#total_seconds ⇒ Object
Returns the value of attribute total_seconds.
2 3 4 |
# File 'lib/transilien/time.rb', line 2 def total_seconds @total_seconds end |
Class Method Details
.from_node(node, access_time) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/transilien/time.rb', line 5 def from_node(node, access_time) item = new item.payload = node item.total_seconds = node.at('TotalSeconds').text item.day = node.at('Day').text item.hour = node.at('Hour').text item.minute = node.at('Minute').text item end |
Instance Method Details
#name ⇒ Object
objective: enable caching
17 18 19 |
# File 'lib/transilien/time.rb', line 17 def name # objective: enable caching "#{day}:#{hour}:#{minutes}|#{total_seconds}" end |