Class: StoryboardLint::Matcher

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

Constant Summary collapse

DEFAULT_SEGUE_ID_PREFIX =
"seg_"
DEFAULT_STORYBOARD_ID_PREFIX =
"sb_"
DEFAULT_REUSE_ID_PREFIX =
"ruid_"

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Matcher



200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/storyboardlint.rb', line 200

def initialize(options)
  options ||= OpenStruct.new
  
  @storyboard_id_regex_source = create_source_regex(DEFAULT_STORYBOARD_ID_PREFIX, options.storyboard_prefix, options.storyboard_suffix)
  @storyboard_id_regex_sb = create_storyboard_regex(DEFAULT_STORYBOARD_ID_PREFIX, options.storyboard_prefix, options.storyboard_suffix)
  
  @segue_id_regex_source = create_source_regex(DEFAULT_SEGUE_ID_PREFIX, options.segue_prefix, options.segue_suffix)
  @segue_id_regex_sb = create_storyboard_regex(DEFAULT_SEGUE_ID_PREFIX, options.segue_prefix, options.segue_suffix)
  
  @reuse_id_regex_source = create_source_regex(DEFAULT_REUSE_ID_PREFIX, options.reuse_prefix, options.reuse_suffix)
  @reuse_id_regex_sb = create_storyboard_regex(DEFAULT_REUSE_ID_PREFIX, options.reuse_prefix, options.reuse_suffix)
end

Instance Method Details

#class_regexObject



213
214
215
# File 'lib/storyboardlint.rb', line 213

def class_regex
  /@interface\s+([a-zA-Z_]+\w*)/
end