Module: Lucid::Shopify::Resource::Base

Defined in:
lib/lucid/shopify/resource/base.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Parameters:

  • base (Class, Module)


29
30
31
# File 'lib/lucid/shopify/resource/base.rb', line 29

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#clientClient

Returns:

  • (Client)


41
42
43
# File 'lib/lucid/shopify/resource/base.rb', line 41

def client
  @client ||= Container[:client]
end

#client=(new_client) ⇒ Object

Parameters:

  • new_client (Client)


46
47
48
# File 'lib/lucid/shopify/resource/base.rb', line 46

def client=(new_client)
  @client = new_client
end

#loggerLogger

Returns:

  • (Logger)


51
52
53
# File 'lib/lucid/shopify/resource/base.rb', line 51

def logger
  @logger ||= Logger.new(IO::NULL)
end

#logger=(new_logger) ⇒ Object

Parameters:

  • new_logger (Logger)


56
57
58
# File 'lib/lucid/shopify/resource/base.rb', line 56

def logger=(new_logger)
  @logger = new_logger
end

#resourceString

This method is abstract.

Returns:

  • (String)

Raises:

  • (NotImplementedError)


36
37
38
# File 'lib/lucid/shopify/resource/base.rb', line 36

def resource
  raise NotImplementedError
end