Class: SfCli::Sf::Org::ListMetadata::MetadataList

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sf_cli/sf/org/list_metadata.rb

Instance Method Summary collapse

Constructor Details

#initialize(metadata_list) ⇒ MetadataList

Returns a new instance of MetadataList.



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 54

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



72
73
74
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 72

def each(&block)
  list.each(&block)
end

#find(name) ⇒ Object



80
81
82
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 80

def find(name)
  list.find{|m| m.name == name.to_s}
end

#namesObject



76
77
78
# File 'lib/sf_cli/sf/org/list_metadata.rb', line 76

def names
  list.map(&:name)
end