Class: Session
- Inherits:
-
Object
- Object
- Session
- Defined in:
- lib/ft_42.rb
Instance Attribute Summary collapse
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #begin_at ⇒ Object
- #duration ⇒ Object
- #end_at ⇒ Object
- #host ⇒ Object
-
#initialize(session) ⇒ Session
constructor
A new instance of Session.
- #primary? ⇒ Boolean
Constructor Details
#initialize(session) ⇒ Session
Returns a new instance of Session.
314 315 316 |
# File 'lib/ft_42.rb', line 314 def initialize(session) @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
312 313 314 |
# File 'lib/ft_42.rb', line 312 def session @session end |
Instance Method Details
#begin_at ⇒ Object
318 319 320 |
# File 'lib/ft_42.rb', line 318 def begin_at session["begin_at"].to_time end |
#duration ⇒ Object
334 335 336 |
# File 'lib/ft_42.rb', line 334 def duration end_at - begin_at unless end_at.nil? end |
#end_at ⇒ Object
322 323 324 |
# File 'lib/ft_42.rb', line 322 def end_at session["end_at"].to_time unless session["end_at"].nil? end |
#host ⇒ Object
326 327 328 |
# File 'lib/ft_42.rb', line 326 def host session["host"] end |
#primary? ⇒ Boolean
330 331 332 |
# File 'lib/ft_42.rb', line 330 def primary? session["primary"] end |