Class: Fakeit::App::Options
- Inherits:
-
Object
- Object
- Fakeit::App::Options
- Defined in:
- lib/fakeit/app/options.rb
Instance Attribute Summary collapse
-
#permissive ⇒ Object
readonly
Returns the value of attribute permissive.
-
#use_example ⇒ Object
readonly
Returns the value of attribute use_example.
Instance Method Summary collapse
-
#initialize(permissive: false, use_example: false, static: false, static_types: [], static_properties: []) ⇒ Options
constructor
A new instance of Options.
- #to_hash ⇒ Object
- #use_static?(type: nil, property: nil) ⇒ Boolean
Constructor Details
#initialize(permissive: false, use_example: false, static: false, static_types: [], static_properties: []) ⇒ Options
Returns a new instance of Options.
6 7 8 9 10 11 12 |
# File 'lib/fakeit/app/options.rb', line 6 def initialize(permissive: false, use_example: false, static: false, static_types: [], static_properties: []) @permissive = permissive @use_example = use_example @static = static @static_types = static_types @static_properties = static_properties end |
Instance Attribute Details
#permissive ⇒ Object (readonly)
Returns the value of attribute permissive.
4 5 6 |
# File 'lib/fakeit/app/options.rb', line 4 def permissive @permissive end |
#use_example ⇒ Object (readonly)
Returns the value of attribute use_example.
4 5 6 |
# File 'lib/fakeit/app/options.rb', line 4 def use_example @use_example end |
Instance Method Details
#to_hash ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/fakeit/app/options.rb', line 18 def to_hash { permissive: @permissive, use_example: @use_example, static: @static, static_types: @static_types, static_properties: @static_properties } end |
#use_static?(type: nil, property: nil) ⇒ Boolean
14 15 16 |
# File 'lib/fakeit/app/options.rb', line 14 def use_static?(type: nil, property: nil) @static || @static_types.include?(type) || @static_properties.include?(property) end |