Class: Mints::User
- Inherits:
-
Object
- Object
- Mints::User
- Defined in:
- lib/user.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #create_company(data, options = nil) ⇒ Object
- #create_contact(data, options = nil) ⇒ Object
- #create_content_instance(data, options = nil) ⇒ Object
- #create_content_page(data, options = nil) ⇒ Object
- #create_deal(data, options = nil) ⇒ Object
- #create_location(data, options = nil) ⇒ Object
- #create_price(data, options = nil) ⇒ Object
- #create_price_list(data, options = nil) ⇒ Object
- #create_prodict_brand(data, options = nil) ⇒ Object
- #create_prodict_template(data, options = nil) ⇒ Object
- #create_prodict_type(data, options = nil) ⇒ Object
- #create_product(data, options = nil) ⇒ Object
- #create_sku(data, options = nil) ⇒ Object
- #create_story(data, options = nil) ⇒ Object
- #create_story_template(data, options = nil) ⇒ Object
-
#get_companies(options = nil) ⇒ Object
Companies ###.
- #get_company(id, options = nil) ⇒ Object
- #get_contact(id, options = nil) ⇒ Object
-
#get_contacts(options = nil) ⇒ Object
CRM ######################################### Contacts ###.
- #get_content_instance(id, options = nil) ⇒ Object
-
#get_content_instances(options = nil) ⇒ Object
Content instances ###.
- #get_content_page(id, options = nil) ⇒ Object
-
#get_content_pages(options = nil) ⇒ Object
Content pages ###.
-
#get_content_templates(options = nil) ⇒ Object
Content templates ###.
- #get_deal(id, options = nil) ⇒ Object
-
#get_deals(options = nil) ⇒ Object
Deals ###.
- #get_location(id, options = nil) ⇒ Object
-
#get_locations(options = nil) ⇒ Object
Locations ###.
- #get_price(id, options = nil) ⇒ Object
- #get_price_list(id, options = nil) ⇒ Object
-
#get_price_lists(options = nil) ⇒ Object
Price lists ###.
-
#get_prices(options = nil) ⇒ Object
Prices ###.
- #get_prodict_brand(id, options = nil) ⇒ Object
- #get_prodict_template(id, options = nil) ⇒ Object
- #get_prodict_type(id, options = nil) ⇒ Object
- #get_product(id, options = nil) ⇒ Object
-
#get_product_brands(options = nil) ⇒ Object
Product brands ###.
-
#get_product_templates(options = nil) ⇒ Object
Product templates ###.
-
#get_product_types(options = nil) ⇒ Object
Product types ###.
-
#get_products(options = nil) ⇒ Object
Ecommerce ######################################### Products ###.
- #get_sku(id, options = nil) ⇒ Object
-
#get_skus(options = nil) ⇒ Object
SKUs ###.
-
#get_stories(options = nil) ⇒ Object
Content ######################################### Stories ###.
- #get_story(id, options = nil) ⇒ Object
- #get_story_template(id, options = nil) ⇒ Object
-
#get_story_templates(options = nil) ⇒ Object
Stories templates ###.
-
#initialize(host, api_key, session_token = nil) ⇒ User
constructor
A new instance of User.
- #login(email, password) ⇒ Object
- #update_company(id, data, options = nil) ⇒ Object
- #update_contact(id, data, options = nil) ⇒ Object
- #update_content_instance(id, data, options = nil) ⇒ Object
- #update_content_page(id, data, options = nil) ⇒ Object
- #update_deal(id, data, options = nil) ⇒ Object
- #update_location(id, data, options = nil) ⇒ Object
- #update_price(id, data, options = nil) ⇒ Object
- #update_price_list(id, data, options = nil) ⇒ Object
- #update_product(id, data, options = nil) ⇒ Object
- #update_product_brand(id, data, options = nil) ⇒ Object
- #update_product_template(id, data, options = nil) ⇒ Object
- #update_product_type(id, data, options = nil) ⇒ Object
- #update_sku(id, data, options = nil) ⇒ Object
- #update_story(id, data, options = nil) ⇒ Object
- #update_story_template(id, data, options = nil) ⇒ Object
Constructor Details
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/user.rb', line 4 def client @client end |
Instance Method Details
#create_company(data, options = nil) ⇒ Object
46 47 48 |
# File 'lib/user.rb', line 46 def create_company(data, = nil) return @client.create__crm__companies(data, ) end |
#create_contact(data, options = nil) ⇒ Object
30 31 32 |
# File 'lib/user.rb', line 30 def create_contact(data, = nil) return @client.create__crm__contacts(data, ) end |
#create_content_instance(data, options = nil) ⇒ Object
115 116 117 |
# File 'lib/user.rb', line 115 def create_content_instance(data, = nil) return @client.create__content__instances(data, ) end |
#create_content_page(data, options = nil) ⇒ Object
132 133 134 |
# File 'lib/user.rb', line 132 def create_content_page(data, = nil) return @client.create__content__pages(data, ) end |
#create_deal(data, options = nil) ⇒ Object
63 64 65 |
# File 'lib/user.rb', line 63 def create_deal(data, = nil) return @client.create__crm__deals(data, ) end |
#create_location(data, options = nil) ⇒ Object
287 288 289 |
# File 'lib/user.rb', line 287 def create_location(data, = nil) return @client.create__ecommerce__locations(data, ) end |
#create_price(data, options = nil) ⇒ Object
201 202 203 |
# File 'lib/user.rb', line 201 def create_price(data, = nil) return @client.create__ecommerce__prices(data, ) end |
#create_price_list(data, options = nil) ⇒ Object
218 219 220 |
# File 'lib/user.rb', line 218 def create_price_list(data, = nil) return @client.create__ecommerce__price_lists(data, ) end |
#create_prodict_brand(data, options = nil) ⇒ Object
235 236 237 |
# File 'lib/user.rb', line 235 def create_prodict_brand(data, = nil) return @client.create__ecommerce__product_brands(data, ) end |
#create_prodict_template(data, options = nil) ⇒ Object
269 270 271 |
# File 'lib/user.rb', line 269 def create_prodict_template(data, = nil) return @client.create__ecommerce__product_templates(data, ) end |
#create_prodict_type(data, options = nil) ⇒ Object
252 253 254 |
# File 'lib/user.rb', line 252 def create_prodict_type(data, = nil) return @client.create__ecommerce__product_types(data, ) end |
#create_product(data, options = nil) ⇒ Object
167 168 169 |
# File 'lib/user.rb', line 167 def create_product(data, = nil) return @client.create__ecommerce__products(data, ) end |
#create_sku(data, options = nil) ⇒ Object
184 185 186 |
# File 'lib/user.rb', line 184 def create_sku(data, = nil) return @client.create__ecommerce__skus(data, ) end |
#create_story(data, options = nil) ⇒ Object
81 82 83 |
# File 'lib/user.rb', line 81 def create_story(data, = nil) return @client.create__content__stories(data, ) end |
#create_story_template(data, options = nil) ⇒ Object
98 99 100 |
# File 'lib/user.rb', line 98 def create_story_template(data, = nil) return @client.create__content__story_templates(data, ) end |
#get_companies(options = nil) ⇒ Object
Companies ###
38 39 40 |
# File 'lib/user.rb', line 38 def get_companies( = nil) return @client.get__crm__companies() end |
#get_company(id, options = nil) ⇒ Object
42 43 44 |
# File 'lib/user.rb', line 42 def get_company(id, = nil) return @client.get__crm__companies(id, ) end |
#get_contact(id, options = nil) ⇒ Object
26 27 28 |
# File 'lib/user.rb', line 26 def get_contact(id, = nil) return @client.get__crm__contacts(id, ) end |
#get_contacts(options = nil) ⇒ Object
CRM ######################################### Contacts ###
22 23 24 |
# File 'lib/user.rb', line 22 def get_contacts( = nil) return @client.get__crm__contacts() end |
#get_content_instance(id, options = nil) ⇒ Object
111 112 113 |
# File 'lib/user.rb', line 111 def get_content_instance(id, = nil) return @client.get__content__instances(id, ) end |
#get_content_instances(options = nil) ⇒ Object
Content instances ###
107 108 109 |
# File 'lib/user.rb', line 107 def get_content_instances( = nil) return @client.get__content__instances() end |
#get_content_page(id, options = nil) ⇒ Object
128 129 130 |
# File 'lib/user.rb', line 128 def get_content_page(id, = nil) return @client.get__content__pages(id, ) end |
#get_content_pages(options = nil) ⇒ Object
Content pages ###
124 125 126 |
# File 'lib/user.rb', line 124 def get_content_pages( = nil) return @client.get__content__pages() end |
#get_content_templates(options = nil) ⇒ Object
Content templates ###
141 142 143 |
# File 'lib/user.rb', line 141 def get_content_templates( = nil) return @client.get__content__templates() end |
#get_deal(id, options = nil) ⇒ Object
59 60 61 |
# File 'lib/user.rb', line 59 def get_deal(id, = nil) return @client.get__crm__deals(id, ) end |
#get_deals(options = nil) ⇒ Object
Deals ###
55 56 57 |
# File 'lib/user.rb', line 55 def get_deals( = nil) return @client.get__crm__deals() end |
#get_location(id, options = nil) ⇒ Object
283 284 285 |
# File 'lib/user.rb', line 283 def get_location(id, = nil) return @client.get__ecommerce__locations(id, ) end |
#get_locations(options = nil) ⇒ Object
Locations ###
279 280 281 |
# File 'lib/user.rb', line 279 def get_locations( = nil) return @client.get__ecommerce__locations() end |
#get_price(id, options = nil) ⇒ Object
197 198 199 |
# File 'lib/user.rb', line 197 def get_price(id, = nil) return @client.get__ecommerce__prices(id, ) end |
#get_price_list(id, options = nil) ⇒ Object
214 215 216 |
# File 'lib/user.rb', line 214 def get_price_list(id, = nil) return @client.get__ecommerce__price_lists(id, ) end |
#get_price_lists(options = nil) ⇒ Object
Price lists ###
210 211 212 |
# File 'lib/user.rb', line 210 def get_price_lists( = nil) return @client.get__ecommerce__price_lists() end |
#get_prices(options = nil) ⇒ Object
Prices ###
193 194 195 |
# File 'lib/user.rb', line 193 def get_prices( = nil) return @client.get__ecommerce__prices() end |
#get_prodict_brand(id, options = nil) ⇒ Object
231 232 233 |
# File 'lib/user.rb', line 231 def get_prodict_brand(id, = nil) return @client.get__ecommerce__product_brands(id, ) end |
#get_prodict_template(id, options = nil) ⇒ Object
265 266 267 |
# File 'lib/user.rb', line 265 def get_prodict_template(id, = nil) return @client.get__ecommerce__product_templates(id, ) end |
#get_prodict_type(id, options = nil) ⇒ Object
248 249 250 |
# File 'lib/user.rb', line 248 def get_prodict_type(id, = nil) return @client.get__ecommerce__product_types(id, ) end |
#get_product(id, options = nil) ⇒ Object
163 164 165 |
# File 'lib/user.rb', line 163 def get_product(id, = nil) return @client.get__ecommerce__products(id, ) end |
#get_product_brands(options = nil) ⇒ Object
Product brands ###
227 228 229 |
# File 'lib/user.rb', line 227 def get_product_brands( = nil) return @client.get__ecommerce__product_brands() end |
#get_product_templates(options = nil) ⇒ Object
Product templates ###
261 262 263 |
# File 'lib/user.rb', line 261 def get_product_templates( = nil) return @client.get__ecommerce__product_templates() end |
#get_product_types(options = nil) ⇒ Object
Product types ###
244 245 246 |
# File 'lib/user.rb', line 244 def get_product_types( = nil) return @client.get__ecommerce__product_types() end |
#get_products(options = nil) ⇒ Object
Ecommerce ######################################### Products ###
159 160 161 |
# File 'lib/user.rb', line 159 def get_products( = nil) return @client.get__ecommerce__products() end |
#get_sku(id, options = nil) ⇒ Object
180 181 182 |
# File 'lib/user.rb', line 180 def get_sku(id, = nil) return @client.get__ecommerce__skus(id, ) end |
#get_skus(options = nil) ⇒ Object
SKUs ###
176 177 178 |
# File 'lib/user.rb', line 176 def get_skus( = nil) return @client.get__ecommerce__skus() end |
#get_stories(options = nil) ⇒ Object
Content ######################################### Stories ###
73 74 75 |
# File 'lib/user.rb', line 73 def get_stories( = nil) return @client.get__content__stories() end |
#get_story(id, options = nil) ⇒ Object
77 78 79 |
# File 'lib/user.rb', line 77 def get_story(id, = nil) return @client.get__content__stories(id, ) end |
#get_story_template(id, options = nil) ⇒ Object
94 95 96 |
# File 'lib/user.rb', line 94 def get_story_template(id, = nil) return @client.get__content__story_templates(id, ) end |
#get_story_templates(options = nil) ⇒ Object
Stories templates ###
90 91 92 |
# File 'lib/user.rb', line 90 def get_story_templates( = nil) return @client.get__content__story_templates() end |
#login(email, password) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/user.rb', line 9 def login(email, password) data = { email: email, password: password, } response = @client.raw("post", "/users/login", nil, data, '/api/v1') if response.key? "api_token" @client.session_token = response["api_token"] end return response end |
#update_company(id, data, options = nil) ⇒ Object
50 51 52 |
# File 'lib/user.rb', line 50 def update_company(id, data, = nil) return @client.update__crm__companies(id, data, ) end |
#update_contact(id, data, options = nil) ⇒ Object
34 35 36 |
# File 'lib/user.rb', line 34 def update_contact(id, data, = nil) return @client.update__crm__contacts(id, data, ) end |
#update_content_instance(id, data, options = nil) ⇒ Object
119 120 121 |
# File 'lib/user.rb', line 119 def update_content_instance(id, data, = nil) return @client.update__content__instances(id, data, ) end |
#update_content_page(id, data, options = nil) ⇒ Object
136 137 138 |
# File 'lib/user.rb', line 136 def update_content_page(id, data, = nil) return @client.update__content__pages(id, data, ) end |
#update_deal(id, data, options = nil) ⇒ Object
67 68 69 |
# File 'lib/user.rb', line 67 def update_deal(id, data, = nil) return @client.update__crm__deals(id, data, ) end |
#update_location(id, data, options = nil) ⇒ Object
291 292 293 |
# File 'lib/user.rb', line 291 def update_location(id, data, = nil) return @client.update__ecommerce__locations(id, data, ) end |
#update_price(id, data, options = nil) ⇒ Object
205 206 207 |
# File 'lib/user.rb', line 205 def update_price(id, data, = nil) return @client.update__ecommerce__prices(id, data, ) end |
#update_price_list(id, data, options = nil) ⇒ Object
222 223 224 |
# File 'lib/user.rb', line 222 def update_price_list(id, data, = nil) return @client.update__ecommerce__price_lists(id, data, ) end |
#update_product(id, data, options = nil) ⇒ Object
171 172 173 |
# File 'lib/user.rb', line 171 def update_product(id, data, = nil) return @client.update__ecommerce__products(id, data, ) end |
#update_product_brand(id, data, options = nil) ⇒ Object
239 240 241 |
# File 'lib/user.rb', line 239 def update_product_brand(id, data, = nil) return @client.update__ecommerce__product_brands(id, data, ) end |
#update_product_template(id, data, options = nil) ⇒ Object
273 274 275 |
# File 'lib/user.rb', line 273 def update_product_template(id, data, = nil) return @client.update__ecommerce__product_templates(id, data, ) end |
#update_product_type(id, data, options = nil) ⇒ Object
256 257 258 |
# File 'lib/user.rb', line 256 def update_product_type(id, data, = nil) return @client.update__ecommerce__product_types(id, data, ) end |
#update_sku(id, data, options = nil) ⇒ Object
188 189 190 |
# File 'lib/user.rb', line 188 def update_sku(id, data, = nil) return @client.update__ecommerce__skus(id, data, ) end |
#update_story(id, data, options = nil) ⇒ Object
85 86 87 |
# File 'lib/user.rb', line 85 def update_story(id, data, = nil) return @client.update__content__stories(id, data, ) end |
#update_story_template(id, data, options = nil) ⇒ Object
102 103 104 |
# File 'lib/user.rb', line 102 def update_story_template(id, data, = nil) return @client.update__content__story_templates(id, data, ) end |