lib/yaks/resource.rb in yaks-0.7.6 vs lib/yaks/resource.rb in yaks-0.7.7
- old
+ new
@@ -4,11 +4,11 @@
type: nil,
rels: [],
links: [],
attributes: {},
subresources: [],
- controls: []
+ forms: []
)
def initialize(attrs = {})
raise attrs.inspect if attrs.key?(:subresources) && !attrs[:subresources].instance_of?(Array)
super
@@ -16,10 +16,14 @@
def [](attr)
attributes[attr]
end
+ def find_form(name)
+ forms.find { |form| form.name == name }
+ end
+
def seq
[self]
end
def self_link
@@ -54,11 +58,11 @@
def add_link(link)
append_to(:links, link)
end
- def add_control(control)
- append_to(:controls, control)
+ def add_form(form)
+ append_to(:forms, form)
end
def add_subresource(subresource)
append_to(:subresources, subresource)
end