Class: Filterparams::Parameter
- Inherits:
-
Object
- Object
- Filterparams::Parameter
- Defined in:
- lib/filterparams/obj/parameter.rb
Instance Attribute Summary collapse
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#name ⇒ Object
Returns the value of attribute name.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #equal?(other) ⇒ Boolean
- #identification ⇒ Object
-
#initialize(name, params = {}) ⇒ Parameter
constructor
A new instance of Parameter.
Constructor Details
#initialize(name, params = {}) ⇒ Parameter
Returns a new instance of Parameter.
5 6 7 8 9 10 |
# File 'lib/filterparams/obj/parameter.rb', line 5 def initialize(name, params = {}) self.name = name self.filter = params[:filter] || nil self.value = params[:value] || nil self.alias = params[:alias] || nil end |
Instance Attribute Details
#alias ⇒ Object
Returns the value of attribute alias.
3 4 5 |
# File 'lib/filterparams/obj/parameter.rb', line 3 def alias @alias end |
#filter ⇒ Object
Returns the value of attribute filter.
3 4 5 |
# File 'lib/filterparams/obj/parameter.rb', line 3 def filter @filter end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/filterparams/obj/parameter.rb', line 3 def name @name end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/filterparams/obj/parameter.rb', line 3 def value @value end |
Instance Method Details
#equal?(other) ⇒ Boolean
20 21 22 23 24 25 26 |
# File 'lib/filterparams/obj/parameter.rb', line 20 def equal?(other) if other.is_a? Parameter name == other.name && self.alias == other.alias else false end end |
#identification ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/filterparams/obj/parameter.rb', line 12 def identification if self.alias.nil? name else self.alias end end |