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