Module: MusicIds::Id::ClassMethods
- Defined in:
- lib/music_ids/id.rb
Instance Method Summary collapse
-
#parse(input, opts = {}) ⇒ ISRC
Parse an identifier string into an instance.
- #relaxed(input) ⇒ Object
Instance Method Details
#parse(input, opts = {}) ⇒ ISRC
Parse an identifier string into an instance
10 11 12 |
# File 'lib/music_ids/id.rb', line 10 def parse(input, opts = {}) opts[:relaxed] ? relaxed(input) : parse_strict(input) end |
#relaxed(input) ⇒ Object
14 15 16 17 18 |
# File 'lib/music_ids/id.rb', line 14 def relaxed(input) parse_string(input) { |input| new(input, ok: false) unless input.nil? } end |