Method: Codex::CodeFilter::Descriptor#initialize
- Defined in:
- lib/codex/filters/code_filter.rb
#initialize(string) ⇒ Descriptor
Returns a new instance of Descriptor.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/codex/filters/code_filter.rb', line 7 def initialize(string) @css_class = "code-normal" @lang = "ruby" if string && string =~ /^\[(.*)\]/ @file_name = nil parse_params($1.dup) elsif string && string =~ /(.*?)\[(.*)\]/ @file_name = $1 parse_params($2.dup) else @file_name = string end end |