Class: ShafClient::ShafForm
- Inherits:
-
Form
- Object
- BaseResource
- Resource
- Form
- ShafClient::ShafForm
- Defined in:
- lib/shaf_client/shaf_form.rb
Constant Summary
Constants included from MimeTypes
MimeTypes::DEFAULT_ADAPTER, MimeTypes::MIME_TYPE_HAL, MimeTypes::MIME_TYPE_JSON
Instance Attribute Summary
Attributes inherited from Resource
Attributes inherited from BaseResource
#attributes, #curies, #embedded_resources, #links
Instance Method Summary collapse
- #content_type ⇒ Object
- #fields ⇒ Object
- #http_method ⇒ Object
- #name ⇒ Object
- #target ⇒ Object
- #title ⇒ Object
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 Method Details
#content_type ⇒ Object
24 25 26 |
# File 'lib/shaf_client/shaf_form.rb', line 24 def content_type attribute(:type) end |
#fields ⇒ Object
28 29 30 31 32 |
# File 'lib/shaf_client/shaf_form.rb', line 28 def fields attribute(:fields).map do |values| Field.new(values.transform_keys(&:to_sym)) end end |
#http_method ⇒ Object
20 21 22 |
# File 'lib/shaf_client/shaf_form.rb', line 20 def http_method attribute(:method).downcase.to_sym end |
#name ⇒ Object
12 13 14 |
# File 'lib/shaf_client/shaf_form.rb', line 12 def name attribute(:name) end |
#target ⇒ Object
16 17 18 |
# File 'lib/shaf_client/shaf_form.rb', line 16 def target attribute(:href) end |
#title ⇒ Object
8 9 10 |
# File 'lib/shaf_client/shaf_form.rb', line 8 def title attribute(:title) end |