Class: IronBank::Describe::Related

Inherits:
Object
  • Object
show all
Defined in:
lib/iron_bank/describe/related.rb

Overview

Describe a related object in Zuora, e.g., an account has a default payment method

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xml(doc) ⇒ Object



11
12
13
# File 'lib/iron_bank/describe/related.rb', line 11

def self.from_xml(doc)
  new(doc)
end

Instance Method Details

#inspectObject



27
28
29
# File 'lib/iron_bank/describe/related.rb', line 27

def inspect
  "#<#{self.class}:0x#{(object_id << 1).to_s(16)} #{name} (#{type})>"
end

#labelObject



23
24
25
# File 'lib/iron_bank/describe/related.rb', line 23

def label
  doc.at_xpath(".//label").text
end

#nameObject



19
20
21
# File 'lib/iron_bank/describe/related.rb', line 19

def name
  doc.at_xpath(".//name").text
end

#typeObject



15
16
17
# File 'lib/iron_bank/describe/related.rb', line 15

def type
  @type ||= doc.attributes["href"].value.split("/").last
end