Class: ThemeCheck::ShopifyLiquid::SourceIndex::BaseEntry

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/theme_check/shopify_liquid/source_index/base_entry.rb

Constant Summary collapse

SHOPIFY_DEV_ROOT_URL =
"https://shopify.dev/api/liquid"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash = {}) ⇒ BaseEntry

Returns a new instance of BaseEntry.



17
18
19
20
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 17

def initialize(hash = {})
  @hash = hash || {}
  @return_type = nil
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



11
12
13
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 11

def hash
  @hash
end

#return_typeObject



50
51
52
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 50

def return_type
  @return_type || to_s
end

Instance Method Details

#deprecated?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 34

def deprecated?
  hash['deprecated']
end

#deprecation_reasonObject



38
39
40
41
42
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 38

def deprecation_reason
  return nil unless deprecated?

  hash['deprecation_reason'] || nil
end

#descriptionObject



30
31
32
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 30

def description
  hash['description'] || ''
end

#nameObject



22
23
24
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 22

def name
  hash['name']
end

#return_type_instanceObject



54
55
56
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 54

def return_type_instance
  ReturnTypeEntry.new(return_type_hash)
end

#shopify_dev_urlObject



44
45
46
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 44

def shopify_dev_url
  SHOPIFY_DEV_ROOT_URL
end

#summaryObject



26
27
28
# File 'lib/theme_check/shopify_liquid/source_index/base_entry.rb', line 26

def summary
  hash['summary'] || ''
end