Class: SfCli::Sf::Sobject::Schema
- Inherits:
-
Object
- Object
- SfCli::Sf::Sobject::Schema
- Defined in:
- lib/sf_cli/sf/sobject/schema.rb
Defined Under Namespace
Instance Method Summary collapse
- #action_overrides ⇒ Object
- #activateable? ⇒ Boolean
- #associateEntityType ⇒ Object
- #associateParentEntity ⇒ Object
- #children_relations ⇒ Object
- #compact_layoutable? ⇒ Boolean
- #createable? ⇒ Boolean
- #custom? ⇒ Boolean
- #custom_setting? ⇒ Boolean
- #deep_cloneable? ⇒ Boolean
- #default_implementation ⇒ Object
- #deletable? ⇒ Boolean
- #deprecated_and_hidden? ⇒ Boolean
- #extended_by ⇒ Object
- #extends_interfaces ⇒ Object
- #feed_enabled? ⇒ Boolean
- #field_labels ⇒ Object
- #field_names ⇒ Object
- #fields ⇒ Object
- #has_subtypes? ⇒ Boolean
- #implemented_by ⇒ Object
- #implements_interfaces ⇒ Object
-
#initialize(schema) ⇒ Schema
constructor
A new instance of Schema.
- #interface? ⇒ Boolean
- #key_prefix ⇒ Object
- #label ⇒ Object
- #label_plural ⇒ Object
- #layoutable? ⇒ Boolean
- #listviewable? ⇒ Boolean
- #lookup_layoutable ⇒ Object
- #mergeable? ⇒ Boolean
- #mruEnabled ⇒ Object
- #name ⇒ Object
- #named_layouts ⇒ Object
- #network_scope_field_name ⇒ Object
- #parent_relations ⇒ Object
- #queryable? ⇒ Boolean
- #record_types ⇒ Object
- #replicateable? ⇒ Boolean
- #retrieveable? ⇒ Boolean
- #search_layoutable? ⇒ Boolean
- #searchable? ⇒ Boolean
- #sobject_describe_option ⇒ Object
- #subtype? ⇒ Boolean
- #supported_scopes ⇒ Object
- #to_h ⇒ Object
- #triggerable? ⇒ Boolean
- #undeletable? ⇒ Boolean
- #updateable? ⇒ Boolean
- #urls ⇒ Object
Constructor Details
#initialize(schema) ⇒ Schema
Returns a new instance of Schema.
5 6 7 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 5 def initialize(schema) @schema = schema end |
Instance Method Details
#action_overrides ⇒ Object
45 46 47 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 45 def action_overrides schema["actionOverrides"] end |
#activateable? ⇒ Boolean
49 50 51 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 49 def activateable? schema["activateable"] end |
#associateEntityType ⇒ Object
53 54 55 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 53 def associateEntityType schema["associateEntityType"] end |
#associateParentEntity ⇒ Object
57 58 59 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 57 def associateParentEntity schema["associateParentEntity"] end |
#children_relations ⇒ Object
29 30 31 32 33 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 29 def children_relations schema['childRelationships'] .select{|r| r['relationshipName'].nil? == false} .map{|r| {name: r['relationshipName'].to_sym, field: r['field'].to_sym, class_name: r['childSObject'].to_sym}} end |
#compact_layoutable? ⇒ Boolean
61 62 63 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 61 def compact_layoutable? schema["compactLayoutable"] end |
#createable? ⇒ Boolean
65 66 67 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 65 def createable? schema["createable"] end |
#custom? ⇒ Boolean
69 70 71 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 69 def custom? schema["custom"] end |
#custom_setting? ⇒ Boolean
73 74 75 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 73 def custom_setting? schema["customSetting"] end |
#deep_cloneable? ⇒ Boolean
77 78 79 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 77 def deep_cloneable? schema["deepCloneable"] end |
#default_implementation ⇒ Object
81 82 83 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 81 def default_implementation schema["defaultImplementation"] end |
#deletable? ⇒ Boolean
85 86 87 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 85 def deletable? schema["deletable"] end |
#deprecated_and_hidden? ⇒ Boolean
89 90 91 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 89 def deprecated_and_hidden? schema["deprecatedAndHidden"] end |
#extended_by ⇒ Object
93 94 95 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 93 def extended_by schema["extendedBy"] end |
#extends_interfaces ⇒ Object
97 98 99 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 97 def extends_interfaces schema["extendsInterfaces"] end |
#feed_enabled? ⇒ Boolean
101 102 103 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 101 def feed_enabled? schema["feedEnabled"] end |
#field_labels ⇒ Object
25 26 27 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 25 def field_labels @field_labels ||= fields.map{|f| f.label} end |
#field_names ⇒ Object
21 22 23 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 21 def field_names @field_names ||= fields.map{|f| f.name.to_sym} end |
#fields ⇒ Object
17 18 19 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 17 def fields @fields ||= Fields.new(schema) end |
#has_subtypes? ⇒ Boolean
105 106 107 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 105 def has_subtypes? schema["hasSubtypes"] end |
#implemented_by ⇒ Object
109 110 111 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 109 def implemented_by schema["implementedBy"] end |
#implements_interfaces ⇒ Object
113 114 115 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 113 def implements_interfaces schema["implementsInterfaces"] end |
#interface? ⇒ Boolean
117 118 119 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 117 def interface? schema["isInterface"] end |
#key_prefix ⇒ Object
125 126 127 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 125 def key_prefix schema["keyPrefix"] end |
#label ⇒ Object
13 14 15 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 13 def label schema['label'] end |
#label_plural ⇒ Object
129 130 131 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 129 def label_plural schema["labelPlural"] end |
#layoutable? ⇒ Boolean
133 134 135 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 133 def layoutable? schema["layoutable"] end |
#listviewable? ⇒ Boolean
137 138 139 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 137 def listviewable? schema["listviewable"] end |
#lookup_layoutable ⇒ Object
141 142 143 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 141 def lookup_layoutable schema["lookupLayoutable"] end |
#mergeable? ⇒ Boolean
145 146 147 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 145 def mergeable? schema["mergeable"] end |
#mruEnabled ⇒ Object
149 150 151 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 149 def mruEnabled schema["mruEnabled"] end |
#name ⇒ Object
9 10 11 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 9 def name schema['name'] end |
#named_layouts ⇒ Object
153 154 155 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 153 def named_layouts schema["namedLayoutInfos"] end |
#network_scope_field_name ⇒ Object
157 158 159 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 157 def network_scope_field_name schema["networkScopeFieldName"] end |
#parent_relations ⇒ Object
35 36 37 38 39 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 35 def parent_relations fields .select{|f| !(f.relationship_name.nil? || f.reference_to.nil?) && f.reference_to.size > 0} .map{|f| {name: f.relationship_name.to_sym, field: f.name.to_sym, class_name: f.reference_to.first.to_sym} } end |
#queryable? ⇒ Boolean
161 162 163 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 161 def queryable? schema["queryable"] end |
#record_types ⇒ Object
165 166 167 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 165 def record_types schema["recordTypeInfos"] end |
#replicateable? ⇒ Boolean
169 170 171 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 169 def replicateable? schema["replicateable"] end |
#retrieveable? ⇒ Boolean
173 174 175 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 173 def retrieveable? schema["retrieveable"] end |
#search_layoutable? ⇒ Boolean
177 178 179 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 177 def search_layoutable? schema["searchLayoutable"] end |
#searchable? ⇒ Boolean
181 182 183 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 181 def searchable? schema["searchable"] end |
#sobject_describe_option ⇒ Object
185 186 187 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 185 def sobject_describe_option schema["sobjectDescribeOption"] end |
#subtype? ⇒ Boolean
121 122 123 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 121 def subtype? schema["isSubtype"] end |
#supported_scopes ⇒ Object
189 190 191 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 189 def supported_scopes schema["supportedScopes"] end |
#to_h ⇒ Object
41 42 43 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 41 def to_h schema end |
#triggerable? ⇒ Boolean
193 194 195 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 193 def triggerable? schema["triggerable"] end |
#undeletable? ⇒ Boolean
197 198 199 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 197 def undeletable? schema["undeletable"] end |
#updateable? ⇒ Boolean
201 202 203 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 201 def updateable? schema["updateable"] end |
#urls ⇒ Object
205 206 207 |
# File 'lib/sf_cli/sf/sobject/schema.rb', line 205 def urls schema["urls"] end |