Class: BigcommerceAPI::OptionSetOption
- Defined in:
- lib/bigcommerce_api/option_set_option.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_required ⇒ Object
Returns the value of attribute is_required.
-
#option_id ⇒ Object
Returns the value of attribute option_id.
-
#option_resource ⇒ Object
Returns the value of attribute option_resource.
-
#option_set_id ⇒ Object
Returns the value of attribute option_set_id.
-
#sort_order ⇒ Object
Returns the value of attribute sort_order.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Resource
#assign_attributes, belongs_to, #changed, #create, #delete, has_many, has_one, http_request, #initialize, #mark_dirty!, #reload, #resource, resource, #save, #update_attributes
Methods inherited from Base
#attributes, clean!, date_adjust, default_options, #initialize, #store, #time, to_rfc2822
Constructor Details
This class inherits a constructor from BigcommerceAPI::Resource
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def display_name @display_name end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def id @id end |
#is_required ⇒ Object
Returns the value of attribute is_required.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def is_required @is_required end |
#option_id ⇒ Object
Returns the value of attribute option_id.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def option_id @option_id end |
#option_resource ⇒ Object
Returns the value of attribute option_resource.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def option_resource @option_resource end |
#option_set_id ⇒ Object
Returns the value of attribute option_set_id.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def option_set_id @option_set_id end |
#sort_order ⇒ Object
Returns the value of attribute sort_order.
3 4 5 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 3 def sort_order @sort_order end |
Class Method Details
.all(option_set_id, params = {}) ⇒ Object
27 28 29 30 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 27 def all(option_set_id, params={}) resources = BigcommerceAPI::Base.get("/option_sets/#{option_set_id}/options", query: date_adjust(params)) (resources.success? and !resources.nil?) ? resources.collect{|r| self.new(r)} : [] end |
.find(option_set_id, id) ⇒ Object
32 33 34 35 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 32 def find(option_set_id, id) r = BigcommerceAPI::Base.get("/option_sets/#{option_set_id}/options/#{id}") (r.success? and !r.nil?) ? self.new(r) : nil end |
Instance Method Details
#find_for_reload ⇒ Object
22 23 24 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 22 def find_for_reload self.class.find(self.option_set_id, self.id) end |
#parent ⇒ Object
18 19 20 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 18 def parent 'option_set' end |
#resource_url ⇒ Object
14 15 16 |
# File 'lib/bigcommerce_api/option_set_option.rb', line 14 def resource_url "option_sets/#{self.option_set_id}/options" end |