Class: Gravaty::Parsers::Force

Inherits:
Object
  • Object
show all
Defined in:
lib/gravaty/parsers/force.rb

Overview

This class is an implementation of the Parsable duck type that checks forces the default value. The only needed parameter is a boolean, with true for forced.

Author

Marco Bresciani

Copyright

Copyright © 2013, 2014, 2015, 2016, 2017, 2018,

2019 Marco Bresciani

License

GNU General Public License version 3

Instance Method Summary collapse

Instance Method Details

#parse(value = false) ⇒ Object

The parsable duck type interface to every parser usage.



34
35
36
37
# File 'lib/gravaty/parsers/force.rb', line 34

def parse(value = false)
  return 'f=y' if value
  ''
end