Class: Despecable::Spectator
- Inherits:
- BasicObject
- Defined in:
- lib/despecable/spectator.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
This class is used to read (eval) the despec block Any methods in that block must be defined here, and this object must be stateful to be read by the controller.
-
#specd ⇒ Object
readonly
This class is used to read (eval) the despec block Any methods in that block must be defined here, and this object must be stateful to be read by the controller.
Instance Method Summary collapse
- #any(name, options = {}) ⇒ Object
- #boolean(name, options = {}) ⇒ Object
- #custom(name, options = {}, &blk) ⇒ Object
- #date(name, options = {}) ⇒ Object
- #datetime(name, options = {}) ⇒ Object
- #file(name, options = {}) ⇒ Object
- #float(name, options = {}) ⇒ Object
-
#initialize(params) ⇒ Spectator
constructor
A new instance of Spectator.
- #integer(name, options = {}) ⇒ Object
- #string(name, options = {}) ⇒ Object
Constructor Details
#initialize(params) ⇒ Spectator
Returns a new instance of Spectator.
9 10 11 12 13 14 15 |
# File 'lib/despecable/spectator.rb', line 9 def initialize(params) @input_params = params # TODO: allow this to be the same object to save copies @params = {} @spectacles = ::Despecable::Spectacles.new @specd = [] end |
Instance Attribute Details
#params ⇒ Object (readonly)
This class is used to read (eval) the despec block Any methods in that block must be defined here, and this object must be stateful to be read by the controller
7 8 9 |
# File 'lib/despecable/spectator.rb', line 7 def params @params end |
#specd ⇒ Object (readonly)
This class is used to read (eval) the despec block Any methods in that block must be defined here, and this object must be stateful to be read by the controller
7 8 9 |
# File 'lib/despecable/spectator.rb', line 7 def specd @specd end |
Instance Method Details
#any(name, options = {}) ⇒ Object
45 46 47 |
# File 'lib/despecable/spectator.rb', line 45 def any(name, = {}) _spec(name, :any, ) end |
#boolean(name, options = {}) ⇒ Object
25 26 27 |
# File 'lib/despecable/spectator.rb', line 25 def boolean(name, = {}) _spec(name, :boolean, ) end |
#custom(name, options = {}, &blk) ⇒ Object
49 50 51 |
# File 'lib/despecable/spectator.rb', line 49 def custom(name, = {}, &blk) _spec(name, :custom, , &blk) end |
#date(name, options = {}) ⇒ Object
29 30 31 |
# File 'lib/despecable/spectator.rb', line 29 def date(name, = {}) _spec(name, :date, ) end |
#datetime(name, options = {}) ⇒ Object
33 34 35 |
# File 'lib/despecable/spectator.rb', line 33 def datetime(name, = {}) _spec(name, :datetime, ) end |
#file(name, options = {}) ⇒ Object
41 42 43 |
# File 'lib/despecable/spectator.rb', line 41 def file(name, = {}) _spec(name, :file, ) end |
#float(name, options = {}) ⇒ Object
37 38 39 |
# File 'lib/despecable/spectator.rb', line 37 def float(name, = {}) _spec(name, :float, ) end |
#integer(name, options = {}) ⇒ Object
17 18 19 |
# File 'lib/despecable/spectator.rb', line 17 def integer(name, = {}) _spec(name, :integer, ) end |
#string(name, options = {}) ⇒ Object
21 22 23 |
# File 'lib/despecable/spectator.rb', line 21 def string(name, = {}) _spec(name, :string, ) end |