Class: MDEXClient::MData::RefinementConfig

Inherits:
Node
  • Object
show all
Defined in:
lib/mdex_client/mdata/refinement_config.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#element

Instance Method Summary collapse

Methods inherited from Node

#css, #dimension_value_state_list, #initialize, #property_list, #record_list, #xpath

Constructor Details

This class inherits a constructor from MDEXClient::MData::Node

Instance Attribute Details

#dimension_value_idObject

Returns the value of attribute dimension_value_id.



6
7
8
# File 'lib/mdex_client/mdata/refinement_config.rb', line 6

def dimension_value_id
  @dimension_value_id
end

#expose=(value) ⇒ Object (writeonly)

Sets the attribute expose

Parameters:

  • value

    the value to set the attribute expose to.



7
8
9
# File 'lib/mdex_client/mdata/refinement_config.rb', line 7

def expose=(value)
  @expose = value
end

#limit_dimension_values=(value) ⇒ Object (writeonly)

Sets the attribute limit_dimension_values

Parameters:

  • value

    the value to set the attribute limit_dimension_values to.



7
8
9
# File 'lib/mdex_client/mdata/refinement_config.rb', line 7

def limit_dimension_values=(value)
  @limit_dimension_values = value
end

#maximum_dimension_value_countObject

Returns the value of attribute maximum_dimension_value_count.



6
7
8
# File 'lib/mdex_client/mdata/refinement_config.rb', line 6

def maximum_dimension_value_count
  @maximum_dimension_value_count
end

#order_by_record_count=(value) ⇒ Object (writeonly)

Sets the attribute order_by_record_count

Parameters:

  • value

    the value to set the attribute order_by_record_count to.



7
8
9
# File 'lib/mdex_client/mdata/refinement_config.rb', line 7

def order_by_record_count=(value)
  @order_by_record_count = value
end

Instance Method Details

#expose?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/mdex_client/mdata/refinement_config.rb', line 20

def expose?
  @expose
end

#initialize_from_element!Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/mdex_client/mdata/refinement_config.rb', line 9

def initialize_from_element!
  @dimension_value_id = @element["DimensionValueId"].to_i
  @expose = (@element["Expose"] == "true")
  @limit_dimension_values = (@element["LimitDimensionValues"] == "true")
  @order_by_record_count = (@element["OrderByRecordCount"] == "true")
  
  if element["MaximumDimensionValueCount"]
    @maximum_dimension_value_count = @element["MaximumDimensionValueCount"].to_i
  end
end

#limit_dimension_values?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/mdex_client/mdata/refinement_config.rb', line 24

def limit_dimension_values?
  @limit_dimension_values
end

#order_by_record_count?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/mdex_client/mdata/refinement_config.rb', line 28

def order_by_record_count?
  @order_by_record_count
end

#write_xml!(xml) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/mdex_client/mdata/refinement_config.rb', line 32

def write_xml!(xml)
  attrs = { "DimensionValueId" => dimension_value_id }
  %w(Expose LimitDimensionValues OrderByRecordCount).each do |attribute|
    value = self.send("#{attribute.underscore}?")
    attrs[attribute] = value.to_s unless value.nil?
  end
  attrs["MaximumDimensionValueCount"] = maximum_dimension_value_count unless maximum_dimension_value_count.nil?
  
  xml.mdata :RefinementConfig, attrs
end