Class: AprsIs::Filter
- Inherits:
-
Object
- Object
- AprsIs::Filter
- Defined in:
- lib/aprs_is/filter.rb,
lib/aprs_is/filter/constants.rb
Defined Under Namespace
Modules: Constants Classes: InvalidTypeError, ValueArityError
Instance Attribute Summary collapse
-
#filter_type ⇒ Object
readonly
Returns the value of attribute filter_type.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(type:, values:) ⇒ Filter
constructor
A new instance of Filter.
- #to_s ⇒ Object
Constructor Details
#initialize(type:, values:) ⇒ Filter
Returns a new instance of Filter.
10 11 12 13 14 15 16 |
# File 'lib/aprs_is/filter.rb', line 10 def initialize(type:, values: ) @filter_type = type @values = values || [] validate_filter_type validate_arity end |
Instance Attribute Details
#filter_type ⇒ Object (readonly)
Returns the value of attribute filter_type.
8 9 10 |
# File 'lib/aprs_is/filter.rb', line 8 def filter_type @filter_type end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
8 9 10 |
# File 'lib/aprs_is/filter.rb', line 8 def values @values end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/aprs_is/filter.rb', line 18 def to_s values.dup.unshift(prefix).compact.join("/") end |