Class: V2Intuity::QueryFilters::QueryFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/v2_intuity/query_filters/filter.rb

Direct Known Subclasses

AccessToken, Date, FormatRedirect, Sort, Source

Constant Summary collapse

QUERY_FILTERS =
{ access_token: 'token', source: 'source',
start_filter: 'start_date_filter',
end_filter: 'end_date_filter',
format_redirect: 'format',
sort: 'sort' }.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ QueryFilter

Returns a new instance of QueryFilter.



12
13
14
15
# File 'lib/v2_intuity/query_filters/filter.rb', line 12

def initialize(options = {})
  @name = options[:name]
  @value = options[:value]
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/v2_intuity/query_filters/filter.rb', line 4

def name
  @name
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/v2_intuity/query_filters/filter.rb', line 4

def value
  @value
end

Instance Method Details

#to_hashObject



17
18
19
# File 'lib/v2_intuity/query_filters/filter.rb', line 17

def to_hash
  { @name.to_sym => @value }
end