Module: Transcriber::Resource::InputParser
- Included in:
- Transcriber::Resource
- Defined in:
- lib/transcriber/resource/input_parser.rb
Instance Method Summary collapse
Instance Method Details
#to_input(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/transcriber/resource/input_parser.rb', line 8 def to_input( = {}) input = {} = {without_nil: [:without_nil], fail: [:fail]} keys_to_input().each do |key| value = __send__(key.name) = .fetch(key.name, {}).merge() input.merge! key.to_input!(value, self, ) end input.with_indifferent_access end |
#to_input!(options = {}) ⇒ Object
4 5 6 |
# File 'lib/transcriber/resource/input_parser.rb', line 4 def to_input!( = {}) to_input(.merge(fail: true)) end |