Class: Perfer::Session::MetadataSetter

Inherits:
Object
  • Object
show all
Defined in:
lib/perfer/session.rb

Instance Method Summary collapse

Constructor Details

#initializeMetadataSetter

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 tags *tags
  @metadata[:tags] ||= []
  @metadata[:tags] |= tags.map(&:to_s)
end

#to_hashObject



173
174
175
# File 'lib/perfer/session.rb', line 173

def to_hash
  @metadata
end