Class: EPlat::ScriptTag

Inherits:
Base
  • Object
show all
Defined in:
lib/e_plat/resource/script_tag.rb

Constant Summary

Constants included from Concerns::GraphQLable

Concerns::GraphQLable::FILTER_ARGS, Concerns::GraphQLable::QUERY_ARG_ARGS

Instance Attribute Summary

Attributes inherited from Base

#mapped_attributes, #mapping

Attributes included from Concerns::Aliases

#type_coercer

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

cached_shopify_webhook?, client, #client, exclude_from_json, #formatted_id, #graphql_input, #headers, #include_root_in_json, inherited, #initialize, initialize_singleton!, #mapped?, #native_keys, platform_specific_class?, prefix=, #read_only?

Methods included from Countable

#count

Methods included from Concerns::GraphQLable

#graphql_mutation_string, #mutate_graphql, #remove_mutation_root_from

Methods included from Concerns::Aliases

#add_aliases!

Methods included from Concerns::FullJson

#as_full_json, #to_full_json

Methods included from Concerns::OverwriteRequestMethods

included

Methods included from Concerns::OverwriteInstanceMethods

#as_eplat_json, #as_json, #create, #create_resource_for, #to_eplat_json, #to_json, #update

Constructor Details

This class inherits a constructor from EPlat::Base

Class Method Details

.collection_path(prefix_options = {}, query_options = nil) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/e_plat/resource/script_tag.rb', line 31

def self.collection_path(prefix_options = {}, query_options = nil)
    if client.bigcommerce?
        super(prefix_options, query_options).gsub("script_tags", "scripts")
    else
        super(prefix_options, query_options)
    end
end

.element_path(id, prefix_options = {}, query_options = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/e_plat/resource/script_tag.rb', line 23

def self.element_path(id, prefix_options = {}, query_options = nil)
    if client.bigcommerce?
        super(id, prefix_options, query_options).gsub("script_tags", "scripts")
    else
        super(id, prefix_options, query_options)
    end
end

Instance Method Details

#collection_path(options = {}) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/e_plat/resource/script_tag.rb', line 47

def collection_path(options = {})
    if client.bigcommerce?
        super(options).gsub("script_tags", "scripts")
    else
        super(options)
    end
end

#element_path(options = {}) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/e_plat/resource/script_tag.rb', line 39

def element_path(options = {})
    if client.bigcommerce?
        super(options).gsub("script_tags", "scripts")
    else
        super(options)
    end
end

#to_paramObject



15
16
17
18
19
20
21
# File 'lib/e_plat/resource/script_tag.rb', line 15

def to_param  
    if client.bigcommerce?
        uuid && uuid.to_s
    else
        super
    end
end