Skip to content

Commit

Permalink
Adding raw xml and mods methods to models
Browse files Browse the repository at this point in the history
  • Loading branch information
dgcliff committed Jan 30, 2024
1 parent 29627af commit 4295c69
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.41
0.0.42
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
atlas_rb (0.0.41)
atlas_rb (0.0.42)
faraday (~> 2.7)
faraday-follow_redirects (~> 0.3.0)
faraday-multipart (~> 1)
Expand Down
8 changes: 8 additions & 0 deletions lib/atlas_rb/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,13 @@ def self.update(id, xml_path)
def self.metadata(id, values)
JSON.parse(connection({ metadata: values }).patch(ROUTE + id)&.body)
end

def self.mods(id)
connection({}).get(ROUTE + id + '/mods.html')&.body
end

def self.xml(id)
connection({}).get(ROUTE + id + '/mods')&.body
end
end
end
8 changes: 8 additions & 0 deletions lib/atlas_rb/community.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,13 @@ def self.update(id, xml_path)
def self.metadata(id, values)
JSON.parse(connection({ metadata: values }).patch(ROUTE + id)&.body)
end

def self.mods(id)
connection({}).get(ROUTE + id + '/mods.html')&.body
end

def self.xml(id)
connection({}).get(ROUTE + id + '/mods')&.body
end
end
end
5 changes: 4 additions & 1 deletion lib/atlas_rb/work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ def self.update(id, xml_path)
end

def self.mods(id)
# optional second argument for pure json response?
connection({}).get(ROUTE + id + '/mods.html')&.body
end

def self.xml(id)
connection({}).get(ROUTE + id + '/mods')&.body
end
end
end

0 comments on commit 4295c69

Please sign in to comment.