class ModelTranscribers::ContentAdapter
Attributes
content[RW]
transcript[RW]
Public Class Methods
new(transcript, content)
click to toggle source
# File lib/model_transcribers.rb, line 111 def initialize(transcript, content) @transcript = transcript @content = content end
Public Instance Methods
content_from(source)
click to toggle source
# File lib/model_transcribers.rb, line 116 def content_from(source) if @content.is_a?(Proc) source.instance_exec(&@content) elsif @content.is_a?(Symbol) source.send(@content) else raise "Can only handle Proc or Symbol. (Got #{@content.class})" end end