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.
142 143 144 |
# File 'lib/ft_42.rb', line 142 def initialize(session) @session = session end |
Instance Attribute Details
#session ⇒ Object (readonly)
Returns the value of attribute session.
140 141 142 |
# File 'lib/ft_42.rb', line 140 def session @session end |
Instance Method Details
#begin_at ⇒ Object
146 147 148 |
# File 'lib/ft_42.rb', line 146 def begin_at session["begin_at"].to_time end |
#duration ⇒ Object
162 163 164 |
# File 'lib/ft_42.rb', line 162 def duration end_at - begin_at end |
#end_at ⇒ Object
150 151 152 |
# File 'lib/ft_42.rb', line 150 def end_at session["end_at"].to_time end |
#host ⇒ Object
154 155 156 |
# File 'lib/ft_42.rb', line 154 def host session["host"] end |
#primary? ⇒ Boolean
158 159 160 |
# File 'lib/ft_42.rb', line 158 def primary? session["primary"] end |