Module: Onebox::Mixins::GitBlobOnebox::InstanceMethods
- Defined in:
- lib/onebox/mixins/git_blob_onebox.rb
Instance Method Summary collapse
Instance Method Details
#initialize(url, timeout = nil) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/onebox/mixins/git_blob_onebox.rb', line 28 def initialize(url, timeout = nil) super url, timeout # merge engine options from global Onebox.options interface # self.options = Onebox.options["GithubBlobOnebox"] # self.class.name.split("::").last.to_s # self.options = Onebox.options[self.class.name.split("::").last.to_s] #We can use this a more generic approach. extract the engine class name automatically self. = DEFAULTS @selected_lines_array = nil @selected_one_liner = 0 @model_file = nil # Define constant after merging options set in Onebox.options # We can define constant automatically. .each_pair do |constant_name, value| constant_name_u = constant_name.to_s.upcase if constant_name_u == constant_name.to_s #define a constant if not already defined unless self.class.const_defined? constant_name_u.to_sym Onebox::Mixins::GitBlobOnebox.const_set constant_name_u.to_sym , [constant_name_u.to_sym] end end end end |