Class: MDEXClient::MData::Record

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

Direct Known Subclasses

AggregateRecord

Defined Under Namespace

Classes: Attributes

Instance Attribute Summary collapse

Attributes inherited from Node

#element

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(element_or_hash = nil) ⇒ Record

Returns a new instance of Record.



43
44
45
46
# File 'lib/mdex_client/mdata/record.rb', line 43

def initialize(element_or_hash=nil)
  @attributes = Attributes.new
  super(element_or_hash)
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



41
42
43
# File 'lib/mdex_client/mdata/record.rb', line 41

def attributes
  @attributes
end

#idObject

Returns the value of attribute id.



41
42
43
# File 'lib/mdex_client/mdata/record.rb', line 41

def id
  @id
end

#snippetsObject

Returns the value of attribute snippets.



41
42
43
# File 'lib/mdex_client/mdata/record.rb', line 41

def snippets
  @snippets
end

Instance Method Details

#initialize_from_element!Object



48
49
50
51
52
53
54
55
56
# File 'lib/mdex_client/mdata/record.rb', line 48

def initialize_from_element!
  @id = @element["Id"]
  
  xpath("mdata:Attributes/mdata:AssignedDimensionValue | mdata:Attributes/mdata:Property").each do |attribute|
    @attributes << attribute  
  end
  
  @snippets = property_list("mdata:Snippets/mdata:Snippet")
end