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.
136 137 138 |
# File 'lib/ft_42.rb', line 136 def initialize(session) @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
134 135 136 |
# File 'lib/ft_42.rb', line 134 def session @session end |
Instance Method Details
#begin_at ⇒ Object
140 141 142 |
# File 'lib/ft_42.rb', line 140 def begin_at session["begin_at"].to_time end |
#duration ⇒ Object
156 157 158 |
# File 'lib/ft_42.rb', line 156 def duration end_at - begin_at end |
#end_at ⇒ Object
144 145 146 |
# File 'lib/ft_42.rb', line 144 def end_at session["end_at"].to_time end |
#host ⇒ Object
148 149 150 |
# File 'lib/ft_42.rb', line 148 def host session["host"] end |
#primary? ⇒ Boolean
152 153 154 |
# File 'lib/ft_42.rb', line 152 def primary? session["primary"] end |