Class: SfCli::Sf::Org::ListMetadata::MetadataList
- Inherits:
-
Object
- Object
- SfCli::Sf::Org::ListMetadata::MetadataList
- Includes:
- Enumerable
- Defined in:
- lib/sf_cli/sf/org/list_metadata.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #find(name) ⇒ Object
-
#initialize(metadata_list) ⇒ MetadataList
constructor
A new instance of MetadataList.
- #names ⇒ Object
Constructor Details
#initialize(metadata_list) ⇒ MetadataList
Returns a new instance of MetadataList.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 56 def initialize() @list = .map do |m| Metadata.new( created_by_id: m['createdById'], created_by_name: m['createdByName'], created_date: m['createdDate'], file_name: m['fileName'], full_name: m['fullName'], id: m['id'], last_modified_by_id: m['lastModifiedById'], last_modified_by_name: m['lastModifiedByName'], last_modified_date: m['lastModifiedDate'], manageable_state: m['manageableState'], type: m['type'] ) end end |
Instance Method Details
#each(&block) ⇒ Object
74 75 76 |
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 74 def each(&block) list.each(&block) end |
#find(name) ⇒ Object
82 83 84 |
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 82 def find(name) list.find{|m| m.name == name.to_s} end |
#names ⇒ Object
78 79 80 |
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 78 def names list.map(&:name) end |