Class: ShafClient::HalForm
- Inherits:
-
Form
- Object
- BaseResource
- Resource
- Form
- ShafClient::HalForm
- Defined in:
- lib/shaf_client/hal_form.rb
Constant Summary
Constants included from MimeTypes
MimeTypes::DEFAULT_ADAPTER, MimeTypes::MIME_TYPE_HAL, MimeTypes::MIME_TYPE_JSON
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
Attributes inherited from Resource
Attributes inherited from BaseResource
#attributes, #curies, #embedded_resources, #links
Instance Method Summary collapse
Methods inherited from Form
#[], #[]=, #submit, #valid?, #values
Methods inherited from Resource
build, content_type, #destroy!, #get, #get_doc, #get_hal_form, #initialize, #inspect, profile, #reload!
Methods inherited from BaseResource
#[], #actions, #attribute, #curie, #embedded, #initialize, #inspect, #link, #rel?, #to_h, #to_s
Constructor Details
This class inherits a constructor from ShafClient::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShafClient::BaseResource
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
5 6 7 |
# File 'lib/shaf_client/hal_form.rb', line 5 def target @target end |
Instance Method Details
#content_type ⇒ Object
21 22 23 |
# File 'lib/shaf_client/hal_form.rb', line 21 def content_type template[:contentType] || 'application/json' end |
#fields ⇒ Object
25 26 27 28 29 |
# File 'lib/shaf_client/hal_form.rb', line 25 def fields template[:properties].map do |values| Field.new(values.transform_keys(&:to_sym)) end end |
#http_method ⇒ Object
17 18 19 |
# File 'lib/shaf_client/hal_form.rb', line 17 def http_method template[:method].downcase.to_sym end |
#name ⇒ Object
13 14 15 |
# File 'lib/shaf_client/hal_form.rb', line 13 def name attribute(:name) end |
#title ⇒ Object
9 10 11 |
# File 'lib/shaf_client/hal_form.rb', line 9 def title template[:title] end |