Class: ApiSerializer::QueryableConfig

Inherits:
Data
  • Object
show all
Defined in:
lib/api_serializer/queryable_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filter: true, sort: true, column: nil, transform: nil, allowed_values: nil) ⇒ QueryableConfig

Returns a new instance of QueryableConfig.



3
4
5
# File 'lib/api_serializer/queryable_config.rb', line 3

def initialize(filter: true, sort: true, column: nil, transform: nil, allowed_values: nil)
  super
end

Instance Attribute Details

#allowed_valuesObject (readonly)

Returns the value of attribute allowed_values

Returns:

  • (Object)

    the current value of allowed_values



2
3
4
# File 'lib/api_serializer/queryable_config.rb', line 2

def allowed_values
  @allowed_values
end

#columnObject (readonly)

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



2
3
4
# File 'lib/api_serializer/queryable_config.rb', line 2

def column
  @column
end

#filterObject (readonly)

Returns the value of attribute filter

Returns:

  • (Object)

    the current value of filter



2
3
4
# File 'lib/api_serializer/queryable_config.rb', line 2

def filter
  @filter
end

#sortObject (readonly)

Returns the value of attribute sort

Returns:

  • (Object)

    the current value of sort



2
3
4
# File 'lib/api_serializer/queryable_config.rb', line 2

def sort
  @sort
end

#transformObject (readonly)

Returns the value of attribute transform

Returns:

  • (Object)

    the current value of transform



2
3
4
# File 'lib/api_serializer/queryable_config.rb', line 2

def transform
  @transform
end

Instance Method Details

#filterable?Boolean

Returns:

  • (Boolean)


7
# File 'lib/api_serializer/queryable_config.rb', line 7

def filterable? = !!filter

#sortable?Boolean

Returns:

  • (Boolean)


8
# File 'lib/api_serializer/queryable_config.rb', line 8

def sortable? = !!sort