Class: Sem4r::TIdeaTypeAttribute

Inherits:
Object
  • Object
show all
Includes:
Sem4rSoap::SoapAttributes
Defined in:
lib/sem4r/targeting_idea/targeting_idea.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sem4rSoap::SoapAttributes

#_from_element, #_to_s, #_to_xml, included

Constructor Details

#initialize(&block) ⇒ TIdeaTypeAttribute

Returns a new instance of TIdeaTypeAttribute.



146
147
148
149
150
# File 'lib/sem4r/targeting_idea/targeting_idea.rb', line 146

def initialize(&block)
  if block_given?
    block.arity < 1 ? instance_eval(&block) : block.call(self)
  end
end

Class Method Details

.from_element(el) ⇒ Object



152
153
154
155
156
# File 'lib/sem4r/targeting_idea/targeting_idea.rb', line 152

def self.from_element( el )
  new do
    value       el.at_xpath("value").text
  end
end

Instance Method Details

#to_sObject



158
159
160
# File 'lib/sem4r/targeting_idea/targeting_idea.rb', line 158

def to_s
  "Idea '#{value}'"
end