Class: Perfer::Session::MetadataSetter
- Inherits:
-
Object
- Object
- Perfer::Session::MetadataSetter
- Defined in:
- lib/perfer/session.rb
Instance Method Summary collapse
- #description(description) ⇒ Object
- #generator(&block) ⇒ Object
-
#initialize ⇒ MetadataSetter
constructor
A new instance of MetadataSetter.
- #start(n) ⇒ Object
- #tags(*tags) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ MetadataSetter
Returns a new instance of MetadataSetter.
152 153 154 |
# File 'lib/perfer/session.rb', line 152 def initialize @metadata = {} end |
Instance Method Details
#description(description) ⇒ Object
156 157 158 |
# File 'lib/perfer/session.rb', line 156 def description description @metadata[:description] = description end |
#generator(&block) ⇒ Object
169 170 171 |
# File 'lib/perfer/session.rb', line 169 def generator &block @metadata[:generator] = block end |
#start(n) ⇒ Object
165 166 167 |
# File 'lib/perfer/session.rb', line 165 def start n @metadata[:start] = n end |
#tags(*tags) ⇒ Object
160 161 162 163 |
# File 'lib/perfer/session.rb', line 160 def * @metadata[:tags] ||= [] @metadata[:tags] |= .map(&:to_s) end |
#to_hash ⇒ Object
173 174 175 |
# File 'lib/perfer/session.rb', line 173 def to_hash @metadata end |