Class: Gravaty::Parsers::Callback

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

Overview

This class is an implementation of the Parsable duck type that provides the callback name. The only needed parameter is a valid callback String name.

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 = nil) ⇒ Object

The parsable duck type interface to every parser usage.



35
36
37
38
# File 'lib/gravaty/parsers/callback.rb', line 35

def parse(value = nil)
  return "callback=#{value}" unless value.nil? or value.empty?
  ''
end