Module: Cloverly::Base

Included in:
Account, Estimate, Purchase, Source
Defined in:
lib/cloverly/base.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



21
22
23
24
25
# File 'lib/cloverly/base.rb', line 21

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

Instance Method Details

#attributes=(json) ⇒ Object



7
8
9
10
11
# File 'lib/cloverly/base.rb', line 7

def attributes=(json)
  json.each do |key, value|
    self.define_singleton_method(key, -> { value })
  end
end

#initialize(cloverly_instance) ⇒ Object



3
4
5
# File 'lib/cloverly/base.rb', line 3

def initialize(cloverly_instance)
  @cloverly_instance = cloverly_instance
end

#json=(json) ⇒ Object



17
18
19
# File 'lib/cloverly/base.rb', line 17

def json=(json)
  @json = json
end

#to_jsonObject



13
14
15
# File 'lib/cloverly/base.rb', line 13

def to_json
  @json
end