Class: Gattica::Segment

Inherits:
Object
  • Object
show all
Includes:
Convertible
Defined in:
lib/gattica/segment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Convertible

#to_h, #to_query, #to_s, #to_xml

Constructor Details

#initialize(xml) ⇒ Segment

Returns a new instance of Segment.



10
11
12
13
14
# File 'lib/gattica/segment.rb', line 10

def initialize(xml)
  @id = xml.attributes['id']
  @name = xml.attributes['name']
  @definition = xml.at("dxp:definition").inner_html
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition.



8
9
10
# File 'lib/gattica/segment.rb', line 8

def definition
  @definition
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/gattica/segment.rb', line 8

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/gattica/segment.rb', line 8

def name
  @name
end