Class: IronBank::Describe::Field

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

Overview

Describe a field in Zuora: name, label, type, etc.

Constant Summary collapse

TEXT_VALUES =
%i[
  name
  label
  type
].freeze
PLURAL_VALUES =
%i[
  options
  contexts
].freeze
BOOLEAN_VALUES =
%i[
  selectable
  createable
  updateable
  filterable
  custom
  required
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xml(doc) ⇒ Object



30
31
32
# File 'lib/iron_bank/describe/field.rb', line 30

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

Instance Method Details

#inspectObject



52
53
54
# File 'lib/iron_bank/describe/field.rb', line 52

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

#max_lengthObject

Defined separately because the node name is not ruby-friendly



35
36
37
# File 'lib/iron_bank/describe/field.rb', line 35

def max_length
  doc.at_xpath(".//maxlength").text.to_i
end