Class: RgGen::Core::InputBase::InputValue
- Defined in:
- lib/rggen/core/input_base/input_value.rb
Constant Summary collapse
- NoValue =
Object.new
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #available? ⇒ Boolean
- #empty_value? ⇒ Boolean
-
#initialize(value, options = NoValue, position) ⇒ InputValue
constructor
A new instance of InputValue.
- #match_class?(klass) ⇒ Boolean
- #with_options? ⇒ Boolean
Constructor Details
#initialize(value, options = NoValue, position) ⇒ InputValue
Returns a new instance of InputValue.
9 10 11 12 13 |
# File 'lib/rggen/core/input_base/input_value.rb', line 9 def initialize(value, = NoValue, position) super((value.is_a?(String) && value.strip) || value) @options = @position = position end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/rggen/core/input_base/input_value.rb', line 18 def @options end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
17 18 19 |
# File 'lib/rggen/core/input_base/input_value.rb', line 17 def position @position end |
Instance Method Details
#==(other) ⇒ Object
20 21 22 23 |
# File 'lib/rggen/core/input_base/input_value.rb', line 20 def ==(other) __getobj__ == other || other.is_a?(InputValue) && __getobj__ == other.__getobj__ end |
#available? ⇒ Boolean
39 40 41 |
# File 'lib/rggen/core/input_base/input_value.rb', line 39 def available? true end |
#empty_value? ⇒ Boolean
29 30 31 32 33 |
# File 'lib/rggen/core/input_base/input_value.rb', line 29 def empty_value? return true if value.nil? return true if value.respond_to?(:empty?) && value.empty? false end |
#match_class?(klass) ⇒ Boolean
25 26 27 |
# File 'lib/rggen/core/input_base/input_value.rb', line 25 def match_class?(klass) __getobj__.is_a?(klass) end |
#with_options? ⇒ Boolean
35 36 37 |
# File 'lib/rggen/core/input_base/input_value.rb', line 35 def !@options.equal?(NoValue) end |